Hi,
I got this two technologies to work together but only to a certain degree.
As soon as I want to describe wpf components derived from my own type I'm having problems with namespace mapping. I'm getting following error messages:
- If this type is from another assembly: "Unknown build error, ''clr-namespace:MyNamespace;Assembly=MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' mapping URI is not valid. Line 2 Position 13."
- If this type is from the same assembly: "The "CompileWorkflowTask" task failed unexpectedly. System.ArgumentException: The resource string "UnsupportedProjectType" for the "CompileWorkflowTask" task cannot be found. Confirm that the resource name "UnsupportedProjectType" is correctly spelled, and the resource exists in the task's assembly. at Microsoft.Build.Shared.ErrorUtilities.ThrowArgument(Exception innerException, String resourceName, Object[] args) at Microsoft.Build.Shared.ErrorUtilities.VerifyThrowArgument(Boolean condition, Exception innerException, String resourceName, Object arg0, Object arg1) at Microsoft.Build.Utilities.TaskLoggingHelper.FormatResourceString(String resourceName, Object[] args) at Microsoft.Build.Utilities.TaskLoggingHelper.LogErrorFromResources(String subcategoryResourceName, String errorCode, String helpKeyword, String file, Int32 lineNumber, Int32 columnNumber, Int32 endLineNumber, Int32 endColumnNumber, String messageResourceName, Object[] messageArgs) at Microsoft.Build.Utilities.TaskLoggingHelper.LogErrorFromResources(String messageResourceName, Object[] messageArgs) at System.Workflow.ComponentModel.Compiler.CompileWorkflowTask.ValidateParameters() at System.Workflow.ComponentModel.Compiler.CompileWorkflowTask.Execute() at Microsoft.Build.BuildEngine.TaskEngine.ExecuteTask(ExecutionMode howToExecuteTask, Hashtable projectItemsAvailableToTask, BuildPropertyGroup projectPropertiesAvailableToTask, Boolean& taskClassWasFound)"
My mapping looks like this: <ns0:MyWindow1 x:Class="WorkflowProject1.MyWindow2" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ns0="clr-namespace:WorkflowProject1" > </ns0:MyWindow1> And if type is from another assembly the mapping line was: xmlns:ns0="clr-namespace:ClassLibrary1;Assembly=ClassLibrary1,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
I saw in many samples the namespace mapping working. But all this samples were either WPF or WF only projects.
My way of combining WPF and WF was: - create workflow project - add my wpf window classes - to make it compile (it didn't recognized InitializeComponent method etc.) I added into the project file this line: <Import Project="$(MSBuildBinPath)\Microsoft.WinFX.targets" /> so I had three imports in total: <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> <Import Project="$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.0\Workflow.Targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.WinFX.targets" />
Can anybody tell me how I can get it working?
Thanks!
[Update] BTW I'm using RC1 right now and tried it before also with Beta 2.2 (didn't got it to work either)
| | pkonrad | Is it a requirement that the workflow and the wpf components have to be in a single project, my hunch is that it has to do with the edits to the import section? Does this work if you have a workflow project and reference it from the wpf project? This has been how I have done things in the past, I haven't tried to put them both in the same project.
Technical Evangelist -- Windows Workflow Foundation | | Matt Winkler -- MSFT | Thank you for the hint, I'll try it out.
| | Philipp Konradi |
|