.net MSBuild 构建默认为调试配置
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1629779/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
MSBuild builds defaults to debug configuration
提问by Night Walker
I am trying to use MSBuild release mode, but it always defaults to debug. Any idea why?
我正在尝试使用 MSBuild 发布模式,但它始终默认为调试。知道为什么吗?
msbuild LP.sln /p:buildmode=release
msbuild LP.sln /p:buildmode=release
I checked through the following posts;
我检查了以下帖子;
MSBuild task - Build fails because one solution being built in release instead of debug
MSBuild 任务 - 构建失败,因为在发布而不是调试中构建了一个解决方案
回答by Lars Truijens
That depends on the contents of that buildscript. Visual Studio C# uses the parameter Configurationto switch between Releaseand Debug. Not buildmode. You might want to try the following:
这取决于该构建脚本的内容。Visual Studio C# 使用参数Configuration在Release和Debug之间切换。不是构建模式。您可能想尝试以下操作:
msbuild LP.sln /p:Configuration=Release

