用户登录
用户注册

分享至

使用 MSBuild.exe 在发布模式下构建 C# 解决方案

  • 作者: 老衲终于硬了
  • 来源: 51数据库
  • 2023-02-13

问题描述

我能够使用 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
软件
前端设计
程序设计
Java相关