blog community
WF Dependency property binding throws error on custom activities when changing types
Marcel de Vries, MVP Team System

Syndication

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 


Posted 23-03-2007 7:54 by marcelv

Comments

W.Meints wrote re: WF Dependency property binding throws error on custom activities when changing types
on 23-03-2007 19:39

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

arnoldp wrote re: WF Dependency property binding throws error on custom activities when changing types
on 26-03-2007 7:57

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). :)

Hephie wrote re: WF Dependency property binding throws error on custom activities when changing types
on 28-06-2007 10:14

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

any other ideas?

I can't get this fixed

marcelv wrote re: WF Dependency property binding throws error on custom activities when changing types
on 28-06-2007 11:55

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

marcelv wrote re: WF Dependency property binding throws error on custom activities when changing types
on 29-06-2007 16:25

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

russ wrote re: WF Dependency property binding throws error on custom activities when changing types
on 18-05-2008 14:42

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

marcelv wrote re: WF Dependency property binding throws error on custom activities when changing types
on 18-05-2008 15:46

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.

Steve Morgan - Technology Spot wrote Workflow Foundation error binding properties on custom activities
on 11-08-2008 19:45

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

Robert te Kaat wrote re: WF Dependency property binding throws error on custom activities when changing types
on 10-11-2008 10:05

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

Tony wrote re: WF Dependency property binding throws error on custom activities when changing types
on 13-03-2009 17:14

Thanks, this helped me out today!

Shawna wrote re: WF Dependency property binding throws error on custom activities when changing types
on 06-05-2009 22:30

Unbelieveable!  This worked!  I've been fighting with this problem all day.  I deleted the %temp% files (except a small few that wouldn't delete) and problem solved.  Thanks tons!!

Ludo wrote re: WF Dependency property binding throws error on custom activities when changing types
on 01-12-2009 8:48

Thanks VERY MUCH for this tip, it was driving me insane for 3h !

Ariel wrote re: WF Dependency property binding throws error on custom activities when changing types
on 17-12-2009 0:23

thanks Marcel,

your suggestion solved my problem.

Ctrl+R %temp%

Deleted all the files there.

Closed and opened VS2008,

Try to bind the activity property again.

No error

-Ariel

Raj wrote re: WF Dependency property binding throws error on custom activities when changing types
on 18-03-2010 15:27

Thanks,

This helped me as well. I was going nuts to find that what did i do wrong. come on MSSSSSSSSSS

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Enter code (required)
Powered by Community Server (Commercial Edition), by Telligent Systems