我有以下恶性任务:南特aspnet_compiler.exe发布版本
<!--Compiles the possible release candidate to be used for further testing and possible release -->
<target name="createReleaseCandidateJob">
<xmlpoke file="${nant.project.basedir}/${webApplicationProjectName}/Web.config"
xpath="/configuration/system.web/compilation/@debug"
value="false" />
<exec basedir="." program="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe"
commandline="-p ${webApplicationProjectName} -v/${releaseCandidateOutputDir}"
workingdir="."
failonerror="true"
/>
<echo>Completed Compile RC Job</echo>
</target>
我也已经包括在我的项目下面的代码行:
myVersion = "2.0b";
#if DEBUG
myVersion = Guid.NewId().ToString();
#endif
这是加载某些资产时使用(swf文件)作为查询字符串参数追加,并确保在调试缓存版本时未收到,但一旦发布即可管理。
但是,在我认为应该编译一个relase构建之后,该版本仍然被设置为Guid,表示我还没有实现发布版本。我检查了web.config,并将debug的值更改为false,因此我假设我在aspnet_compiler.exe参数中缺少了一些设置,但我无法在文档中找到任何指示这样的设置。
感谢您的回答,我通过使用msbuild和/ d:Release参数来调用构建作为上一步到asp编译器的工作来解决这个问题。 从你的答案我asuming aspnet编译器调用csharp编译器卸载构建并使用web.config来寻找这样的参数? – DannyT 2011-03-11 17:18:58
正确,就是这样。 – kprobst 2011-03-11 17:20:31