Archive for the ‘My Handy References’ Category

How to fix the issue Unrecognized attribute ‘targetFramework’.

October 2, 2014 Leave a comment


Recently, I am having issues with deploying mvc 4 application to Windows Server 2008 R2.After add the necessary role and features and I setup an application in IIS. However , I received the following error message: Unrecognized attribute ‘targetFramework’.


It turns out that this is because App pool is not configured to use .net 4.0, after changing from .net 2.0 to .net 4.0. It works like a charm.

Note if .net v4.0x does not show up under .NET Framework version dropdown, you can need to install .net or re-register .NET 4 with IIS, you can check my previous blogpost to learn how to do it.

How to fix: Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list

July 21, 2014 Leave a comment


Recently, I am having issues with deploying mvc 4 application to Windows Server 2008 R2.After add the necessary role and features and I setup an application in IIS. However , I received the following error message: PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list



It turns out that this is because ASP.Net was not completely installed with IIS even though I checked that box in the “Add Feature” dialog.


To fix this, I simply ran the following command at the command prompt

%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i

If I had been on a 32 bit system, it would have looked like the following:

%windir%\Microsoft.NET\Framework\v4.0.21006\aspnet_regiis.exe –i



This task is currently locked by a running workflow and cannot be edited. Limitation to both Nintex and SPD workflow

August 15, 2013 Leave a comment

Note, this post is from Nintex Forum here. These limitations apply to both SharePoint designer Workflow and Nintex Workflow as Nintex using the SharePoint workflow engine.

The common cause that I experience is that ‘parent’ workflow is generating more than one task at once. This is common as you can have multiple approvers for certain approval process. You could also have workflow running when the task is created, one of the common scenario is you would like to set a custom column value in your approval task. For me this is huge limitation, as Nintex lover I really hope Nintex could solve this problem with Microsoft going forward.


“This task is currently locked by a running workflow and cannot be edited” is a common message that is seen when an error occurs while the SharePoint workflow engine is processing a task item associated with a workflow.

When a workflow processes a task normally, the following sequence of events is expected to occur:

1.       The process begins.

2.       The workflow places a ‘lock’ on the task so nothing else can change the values while the workflow is processing.

3.       The workflow processes the task.

4.       The lock is released when the task processing is finished.

When the message is encountered, it usually indicates that an error occurred between step 2 and 4. As a result, the lock is never released.

Therefore, the ‘task locked’ message is not an error itself, rather a symptom of another error – the ‘task locked’ message does not indicate what went wrong. In most cases, once this message is encountered, the workflow cannot be made to continue and must be terminated and started again.

The following is a guide that can help troubleshoot the cause of these messages.  Some initial observations to narrow down the potential causes are:

Is the error consistent or intermittent?

When the error is consistent, it will happen every time the workflow is run. When it is intermittent, it may happen regularly, but not every time.

Does the error occur the first time the user tries to respond to a task, or do they respond and notice the workflow does not continue, and when they respond again the error occurs?

If the message is present when the user first responds to the task, the issue would have occurred when the task was created. Otherwise, it would have occurred when the user attempted to respond to the task.


Modifying the task list

A cause of this error appearing consistently the first time a user tries to respond to a task is a modification to the default task list schema. For example, changing the ‘Assigned to’ field in a task list to be a multiple selection will cause the behaviour.

Deleting the workflow task then restoring it from the Recycle bin

If you start a workflow, delete the workflow task then restore it from the Recycle Bin in SharePoint, the workflow will fail with the ‘task locked’ error.  This is confirmed behaviour whether using a SharePoint Designer or a Nintex workflow.  You will need to terminate the workflow and start it again.

Parallel simultaneous responses

A cause of this error appearing inconsistently is multiple users responding to tasks in parallel at the same time. In this scenario, one task will complete correctly and the other will not process. When the user tries again, the ‘task locked’ message will display. Nintex included a workaround for this issue in build 11000. In build 11000 and later, one of the users will receive a message on the task form when they attempt to respond, stating that they need to try again in a few moments.

Additional processing on the task

A cause of this error appearing consistently and inconsistently is having an additional system running on the items in the task list. Some examples include: a workflow running on the task list, an event receiver running on the task list or another automated process querying and updating workflow tasks.

Note: This Microsoft help article ( explains creating a workflow that runs on the task list to update a field on the task. Our experience shows that this causes the ‘Task Locked’ issues when the ‘parent’ workflow is generating more than one task at once.

Isolated system error

If the error is a rare event, or a ‘one off’ event, then an isolated system error may have occurred.

For example, if there is a database connectivity issue while the workflow is processing the task response, the task will lock. In this case, the user will respond to a task but the workflow will not continue. When they respond again, the ‘task locked’ message will display. In this case, there will be an error in the SharePoint ULS Logs at the time that the user originally responded.

Temporary delay while workflow processes

If the workflow is taking a long time to process after a user submits a task, they may notice and try to respond to the task again. They will see the task locked error, but after a number of attempts (or after waiting some time) the task response page eventually indicates the task has been responded to. In this case, nothing actually went wrong, and the error message gives an accurate indication of what is happening – the workflow temporarily locked the task while it was processing. This scenario may occur in a very large workflow, or after the SharePoint application pool has just started.

Modifying the task via a web service with an invalid url

If the Nintex Workflow web service is used to respond to or delegate a task, the site context part of the url must be a valid alternative access mapping url. For example, if you access the web service via the IP address of the SharePoint server, and the IP address is not a valid AAM, the task can become locked.

The workflow has become stuck without any apparent errors

This behaviour can occur as a result of a bug in the SharePoint 2010 workflow engine.  If you do not have the August 2010 Cumulative Update (or later) for SharePoint, and your workflow uses delays, “Flexi-task”, State machine”, “Task Reminder” actions or variables, you could be affected. Check the SharePoint 2010 Updates site here:  The October CU is recommended   The fix is described as “Consider the following scenario. You add a Delay activity to a workflow. Then, you set the duration for the Delay activity. You deploy the workflow in SharePoint Foundation 2010. In this scenario, the workflow is not resumed after the duration of the Delay activity”.

If you find this is occurring in your environment, install the October CU, terminate all the running workflows affected and run them afresh.

Investigative steps

The first step to isolate the issue is to create a new task list on the site and configure the workflow to use it.  Any customizations that were made to the original task list should not be made to the new task list. If the new task list eliminates the issue, then the cause can be attributed to the original task list or a change that was made to it.

To change the task list that the workflow uses:

In Workflow Designer select Settings -> Startup Options

Then configure the task list as required

If any of the scenarios above do not help, check the SharePoint logs for any messages with a category of ‘Workflow Infrastructure’.


The information in this article has been gathered from observations and investigations by Nintex. The sources of these issues are the underlying SharePoint workflow engine. This article will be updated if further causes are discovered.

From <>

How to create multiple lines Text field that can take more than 255 characters in SharePoint2010

January 14, 2013 3 comments

If you ever find the multiline textbox reach the limit of 255 characters, here is you need to do to remove the limit. You need to go to the site settings and then go to the site columns. Next, you need to go to the column setting page and change Allow unlimited length in document libraries from NO to Yes as shown below:



How to enable ping in windows firewall in windows server 2008 r2

April 28, 2012 Leave a comment

If you are unable ping your windows server 2008 r2 machine or if you have a “one way ping problem”. You need to check whether you have it enabled in your windows firewall.To enable it , you need to do the following:

1. You need to go to control panel >> windows firewall >> Advanced settings

2. Go to Inbound Rules and enable File and Printer Sharing (Echo Request – ICMPv4-In),after you have done this ,your computer will become pingable.

How to find which w3wp.exe to attach when debugging your SharePiont2010 project

March 22, 2012 3 comments

When debugging SharePoint2010 project, you need to attach w3wp.exe process, however there are often quite a few of them and it is very hard to figure out which one to attach. Today, I will show you how to find out which process to attach using a tool called process explorer.

1. Download the process explorer and run it after you download it.

2. Find the w3wp.exe processes under wininit.exe right-click the columns header and click Select Columns.

3. Include Command Line under Process Image.

4. Now you can see your IIS site name next to w3wp.exe, in my case I’d like to attach the “SharePoint – BenDev80”.You can see the PID of the process is 2920.

5. From the above process you know the process ID you’d like to attach is 2920, you can then go ahead to attach the process from Visual Studio.

How to fix “Unable to cast COM object of type ‘Microsoft.SharePoint.Library.SPRequestInternalClass’ to interface type ‘Microsoft.SharePoint.Library.ISPRequest” using PowerGUI

March 20, 2012 4 comments

I got the error today when debugging some of my PowerShell Script in PowerGUI. The script works perfectly fine in PowerShell console. Then I had spent a couple of hours scratching my head, trying to figure out why. It turns out that the PowerShell Variables Panel causes the problem. Not quite sure why, but collapse the panel fix the problem.


It throws the following exception when debugging my PowerShell Script.


It turns out that the PowerShell Variables Panel causes the problem. I assume it calls some function to grab value of some of variables which cause the problems.


Collapse or Close the variables panel fix the problem