简体   繁体   English

如何使用NAnt 0.90构建Windows Workflow项目?

[英]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.

相关问题 如何获得要在构建机器上构建的NUnit测试项目? - How do you get an NUnit test project to build on a build machine? 您如何处理WWF,Windows Workflow 4.0中的工作流程定义更改 - How do you deal with changes to Work Flow Definition in WWF, Windows Workflow 4.0 如何强制Console App Project在构建中包含一个文件夹? - How do you force a Console App Project to include a folder in the build? 如何从NANT构建文件创建Visual Studio解决方案和项目文件 - How to create Visual Studio solution and project files from NANT build file 您如何在 azure deveops 管道中构建单个项目工件 - How do you build individual project artifacts in azure deveops pipeline 如果NDepend查询引发警告,我如何自动使nant构建失败 - How do I automatically fail a nant build if NDepend query raises a warning 如何在自定义工作流活动中获取构建详细信息? - How do I get build details in a custom workflow activity? 如何显示自定义窗体Windows工作流自定义活动 - how do I display a custom form windows workflow custom activity 如何配置C#项目以使用Windows SDK 7.1工具进行构建? - How do you configure C# projects to build using Windows SDK 7.1 tools? 如何在NAnt Build期间删除正在使用的网络可执行文件 - How to delete network executable files in use during NAnt Build
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM