我有以下任务:
<!--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 文件)时通过附加为查询字符串参数来使用,并确保在调试缓存版本时不会收到缓存版本,但一旦发布就可以管理。
但是,在我认为应该编译发布版本之后,该版本仍被设置为 Guid,表明我还没有实现发布版本。我检查了 web.config 并且 debug 的值更改为 false 所以我假设我在 aspnet_compiler.exe 参数中缺少一些设置,但我在文档中找不到任何表明这样的内容。