Welcome to Windows Workflow Foundation (WF)
Top Tasks :

WF Community Bloggers

When Is a Well Known Problem Not Well Known?

Quick answer: When I don't know about it? When two experienced co-workers do not know also? I was working on a workflow code sample for an upcoming talk, when I started getting ridculous compilation errors. The compiler could not find the rules definition file when it was clearly available. The workflow designer could find it because I could associate it with a policy activity. The compiler falsely complained about an incorrect type association in a data bind, but it was clearly correct. Once again the designer had no problem doing the data bind. I tried to find an answer on Google with little success. After two hours of experimenting, I tried a different Google query and came up with the following link: https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=612335&SiteID=1. The essence of the solution is the following: "this is a well-known problem with code files that have desigable classes in them - the class that is to be designed has to be the first class in the file. If you do the same thing in windows forms you get the following error: the class Form1 can be designed, but is not the first class in the file. Visual Studio requires that designers use the first class in the file. Move the class code so that it is the first class in the file and try loading the designer again." It turns out I had changed a struct that was defined first in my file to a class. I moved that class to the end of the file and "mirabile dictu" everything worked. So if this is a well known problem, why can't we get an error message just like in the Windows Forms case? While it was clearly my mistake, Microsoft has a share of the blame here. Clearly this requirement makes it easier to build the workflow designer. It would have been just as easy to check if this class was not defined first, and issue an error message. Read More...
Published Friday, March 28, 2008 2:03 PM by Thoughts on Software Development
Anonymous comments are disabled

<March 2008>
SuMoTuWeThFrSa
2425262728291
2345678
9101112131415
16171819202122
23242526272829
303112345

Copyright © 2006 Microsoft Corporation. All Rights Reserved. | Terms of Use | Privacy Statement | Contact Us