[英]How do you build a Windows Workflow Project with NAnt 0.90?
I'm trying to build a Windows Workflow (WF) project using NAnt, but it doesn;t seem to be able to build the ".xoml" and ".rules" files. 我正在尝试使用NAnt构建Windows Workflow(WF)项目,但似乎无法构建“ .xoml”和“ .rules”文件。
Here is the code of the csc task that I'm using: 这是我正在使用的csc任务的代码:
<csc debug="${build.Debug}" warninglevel="${build.WarningLevel}" target="library" output="${path::combine(build.OutputDir,assembly.Name+'.dll')}" verbose="${build.Verbose}" doc="${path::combine(build.OutputDir,assembly.Name+'.xml')}">
<sources basedir="${assembly.BaseDir}">
<include name="**/*.cs" />
<include name="**/*.xoml" />
<include name="**/*.rules" />
</sources>
<resources basedir="${assembly.BaseDir}">
<include name="**/*.xsd" />
<include name="**/*.resx" />
</resources>
<references>
...
</references>
</csc>
Here's the output: 这是输出:
Compiling 21 files to 'c:\\Output\\MyWorkFlowProject.dll'.
将21个文件编译到'c:\\ Output \\ MyWorkFlowProject.dll'。
[csc] c:\\Projects\\MyWorkFlowProject\\AProcessFlow.xoml(1,1): error CS0116: A namespace does not directly contain members such as fields or methods
[csc] c:\\ Projects \\ MyWorkFlowProject \\ AProcessFlow.xoml(1,1):错误CS0116:名称空间不直接包含诸如字段或方法之类的成员
[csc] c:\\Projects\\MyWorkFlowProject\\BProcessFlow.xoml(1,1): error CS0116: A namespace does not directly contain members such as fields or methods
[csc] c:\\ Projects \\ MyWorkFlowProject \\ BProcessFlow.xoml(1,1):错误CS0116:名称空间不直接包含诸如字段或方法之类的成员
[csc] c:\\Projects\\MyWorkFlowProject\\CProcessFlow.rules(1,1): error CS0116: A namespace does not directly contain members such as fields or methods
[csc] c:\\ Projects \\ MyWorkFlowProject \\ CProcessFlow.rules(1,1):错误CS0116:名称空间不直接包含诸如字段或方法之类的成员
[csc] c:\\Projects\\MyWorkFlowProject\\CProcessFlow.xoml(1,1): error CS0116: A namespace does not directly contain members such as fields or methods
[csc] c:\\ Projects \\ MyWorkFlowProject \\ CProcessFlow.xoml(1,1):错误CS0116:名称空间不直接包含诸如字段或方法之类的成员
If you check out how Visual Studio/MSBuild compiles a WF project, you will see it requires a lot more. 如果您查看Visual Studio / MSBuild如何编译WF项目,则将看到它需要更多的资源。
Therefore, use NAnt to drive MSBuild and compile the Visual Studio project files for you is by far the best and only option. 因此,使用NAnt驱动MSBuild并为您编译Visual Studio项目文件是迄今为止最好的也是唯一的选择。
Instead of calling the compiler directly, why not use MSBuild? 为什么不直接使用编译器,而不是直接调用编译器? It handles the compilation, references, etc since it works off the solution file.
由于可以处理解决方案文件,因此它可以处理编译,引用等。 So the settings in the solution and projects will be used, you don't need to write out the parameters as in your example.
因此,将使用解决方案和项目中的设置,而无需像示例中那样写出参数。
NAnt doesn't have any direct functionality for MSBuild like it does for the compilers; NAnt没有像编译器那样直接为MSBuild提供任何功能。 however, NAntContrib has an
msbuild
task. 但是,NAntContrib具有
msbuild
任务。 This is what I use, it makes the compile process very simple in my build script. 这就是我使用的方法,它使构建脚本中的编译过程非常简单。 This is what my compile task looks like:
这是我的编译任务的样子:
<target name="compile" description="build the application">
<loadtasks assembly="${dir.tools}\nantcontrib\NAnt.Contrib.Tasks.dll" />
<msbuild project="${dir.src}\${file.solution}" verbosity="Minimal" failonerror="true" verbose="false">
<property name="Configuration" value="${project.config}" />
</msbuild>
</target>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.