如何从命令行使用Microsoft.Workflow.Compiler.exe(wfc.exe)?

时间:2015-10-22 11:20:32

标签: .net wpf windows xaml

我认为它适用于过时的XOML文件,我知道最好使用msbuild。I've found this - Microsoft.Workflow.Compiler.exe 似乎有些错误,无法打印帮助信息。我得到:

Unhandled Exception: System.ArgumentException: The compiler process was not given arguments or was given an invalid set of arguments. When invoking the process the expected arguments are the path to the compiler input and the path to where the output should be placed.
Parameter name: args
   at Microsoft.Workflow.Compiler.Program.Main(String[] args)

通过传递的XAML文件和/输出参数,它会打印如下信息:

Unhandled Exception: System.Runtime.Serialization.SerializationException: Error in line 1 position 2. Expecting element 'CompilerInput' from namespace 'http://schemas.datacontract.org/2004/07/Microsoft.Workflow.Compiler'.. Encountered 'Element'  with name 'Window', namespace 'http://schemas.microsoft.com/winfx/2006/xaml/presentation'.
   at System.Runtime.Serialization.DataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName, DataContractResolver dataContractResolver)
   at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)
   at System.Runtime.Serialization.DataContractSerializer.ReadObject(XmlReader reader)
   at Microsoft.Workflow.Compiler.Program.ReadCompilerInput(String path)
   at Microsoft.Workflow.Compiler.Program.Main(String[] args)

可执行文件位于%WinDir%\ Microsoft.NET \ Framework \ v4.0.30319

我正在尝试这个的原因是因为它看起来能够编译带有嵌入式C#/ Visual基本代码的单个XML文件,并且对文件扩展名不敏感 - 最终我将能够使用similar technique创建自编译的cmd脚本。

0 个答案:

没有答案