blog community

Welcome to blog community Sign in | Join | Help
in Search

Marcel de Vries, MVP Team System

.NET Technologies, Architecture and Web Development

WF Dependency property binding throws error on custom activities when changing types

The past few weeks I have been working with a team on a fairly large WF implementation that will run a few thousands of wokflows a Day(around 300.000 a day!). You can imagine that this has quite some fun Non functional requirements and currently we are doing a proof of concept to see if we can meet performance requirements. (I must say that I am pretty confident we can make this work)

During the development of custom activities we ran into a very irritating issue that we finally figured out to work around. The problem is that when we develop a custom activity and give it a dependency property of e.g. the type string and then we use it in a workflow things can just bind so that is good. The problem occurs when a developer changes the type of the dependency property to e.g. MyCustomType and then after compilation tries to bind the property of the activity to a new property on the workflow of the correct type.

The designer will now generate a following error:

Path resolved to Referenced activity Property 'MyProperty' whose PropertyType 'MyNamespace.MyCustomType ' does not match with the Target Type 'MyNamespace. MyCustomType'.

Now isn’t that sweet…. It tells me that the type that is exactly the same does not match the type I just try to bind.

It appears that this is caused by some kind of caching that occurs in the visual studio IDE. Once you used the activity with the previous datatype and you change the type later on, it will not pick up the correct new type. The only remedy at this moment is that you need to close the VS IDE and start it up again. Now the IDE will pick up the new types of the property and you can bind your property.

Hope this prevents you from becoming bold while pulling your hairs when you think you hit rock bottom with this exception J 

Published Friday, March 23, 2007 7:54 AM by marcelv

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

W.Meints said:

Martijn and I had exactly the same problem, good to hear we weren't the only ones who had that problem.

March 23, 2007 7:39 PM
 

arnoldp said:

I encountered the same problems as well.

Have your tried the 'clean solution' feature? It seems to solve a lot of the caching problems for me...

Whenever I encounter a problem with designers in VS, I close the workflow, click 'clean solution' and reopen the workflow. Most of the times, this solves it for me (not always). :)

March 26, 2007 7:57 AM
 

Hephie said:

Same problem here, rebuilding or cleaning the project and/or solution didn't help :(

any other ideas?

I can't get this fixed

June 28, 2007 10:14 AM
 

marcelv said:

Well, most of the time you will see an exception that is thrown in the constructor of the workflow. By adding a try/catch block there(arround the initializeComponent) and debugging the workflow by starting a new instance of VS.NET might lead you to the problem. By addign a breakpoint in the catch block and inspecting the call stack you might be able to find where the problem is caused and solve the problem.

Cheers,

Marcel

June 28, 2007 11:55 AM
 

marcelv said:

today we discovered that it will help if you go to the %temp% folder and delete all files there (can be allot) That is the place where temp files are created for the workflow environment as well and removing them and then restarting vs.net solved the problem for us. Hope that might help too.

cheers,

Marcel

June 29, 2007 4:25 PM
 

russ said:

Where is the %temp% folder you talk of please?

May 18, 2008 2:42 PM
 

marcelv said:

Just type %temp% in a run dialog (Window Key + R) and windows will take you to the temp directory configured on your machine. That is why I wrote %temp% in stead of my temp folder location, because it varies per OS and even personal settings in some cases.

May 18, 2008 3:46 PM
 

Steve Morgan - Technology Spot said:

This one had me going round in circles for a good few minutes... While developing a custom activity today

August 11, 2008 7:45 PM
 

Robert te Kaat said:

Just one of the many glitches in the WF-designer. It may help to follow the steps in my blogpost: http://blogs.infosupport.com/porint/archive/2008/09/22/Solving-problems-with-the-WF_2D00_designer.aspx

November 10, 2008 10:05 AM

Leave a Comment

(required) 
(optional)
(required) 
Submit
Powered by Community Server, by Telligent Systems