问题描述
我能够使用 MSBuild.exe 构建解决方案,但我的问题是我只能设法让它在 DEBUG 模式下构建.我需要使用 MSBUILD 在发布模式下构建我的解决方案.
I am able to build a solution using MSBuild.exe, but my issue is I can only manage to get it to build in DEBUG mode. I need to build my solution in Release mode using MSBUILD.
这是我尝试过的
Process msbuild = Process.Start("C:\Windows\Microsoft.NET\Framework\v4.0.30319\MsBuild.exe", solutionfilepath + " /P:Config=Release");
和
Process msbuild = Process.Start("C:\Windows\Microsoft.NET\Framework\v4.0.30319\MsBuild.exe", solutionfilepath + " /P:Configuration=Release");
推荐答案
MsBuild.exe [Path to your solution(*.sln)] /t:Build /p:Configuration=Release /p:TargetFrameworkVersion=v4.0
老衲终于硬了