I’m getting a “type or namespace name could not be found” exception when I try to create an instance of an activity. Target Framework is .Net4 (full profile)
The WF is defined as follows:
<Activity x:Class="MyApp.Workflow.MyWorkflow " ...>
It doesn’t contain any activity code yet, just created it. My calling code:
using MyApp.Workflow;
MyWorkflow workflow = new MyWorkflow();
I made sure all dlls referenced in the workflow’s xaml are referenced. Does anybody have an idea what else I could check?
EDIT – Tried the following :
- Add a new Activity to the project
- Go to any source code file and add a call to activity’s constructor (with syntax highlighting and code completion – intellisense recognizes the type)
- Recompile
Result: The Type of the Workflow (MyApp.Workflow.MyWorkflow) is unknown.
When I do the same thing in another solution with exactly the same references, it works as it should.
OK, found it, eventually. There seems to be a bug in the XAML-parser that causes this to happen. It can easily be reproduced:
WFActivity to that project and place a call to that activity’s constructor somewherexmlns:xyz="clr-namespace:Namespace.That.Contains.Controls"to your Window’s code. If you don’t feel like creating controls, just use the namespace the window is defined in.GodDammit, that cost me an entire day…