WPF and Workflow Foundation : XAML parser compatibility issues


I am absolute and unrestricted proponent of the Windows Presentation Foundation, and I think I cannot say this often enough : It makes things easier and more structured. And I love it, somewhere close to every day.

Now, as three quarters of this year have passed by without any significant smoke rising, I have also had the chance to get to grips with Workflow Foundation, and was literally astounded to see how far Microsoft has taken the idea of XAML (Yes, I'm a bit late to that party). 

Combining the two technologies was the next obvious step, which worked fine until yesterday. 

Here's the story: In my somewhat completed WPF UI, I added a WF Activity. An instance of that Activity could not be created, Visual Studio kept throwing "Namespace or Type not found" like it was candy.
Funny, though, that intellisense proposed both the class and the containing namespace of the Activity.

A more complete description of the issue can be found in my StackOverflow post

After nearly despairing over this, I found out that it must be a XAML parser related issue that occurs in the following constellation:
  • Your WF XAML and WPF XAML are defined in the same assembly
  • Your WPF Window references a namespace that contains WPF XAML (user controls or windows)
  • Your code calls the constructor of a WF defined in XAML
To solve the issue, you have to get rid of either the WPF code parsing or the WF parsing, which can be done by moving it to another assembly. What a day.

Kommentare

Beliebte Posts aus diesem Blog

WPF Diaries : Using HLSL pixel shaders

Getting the Crisp back into your WPF Apps