Visual Studio命令行构建参数

时间:2015-03-25 07:47:44

标签: .net vb.net visual-studio build

当我从Visual Stutio UI(调试配置)构建我的项目并设置选项时: 工具 - >选项 - >项目和搜索 - >构建和运行 - > MSBuild输出详细程度为“Normal”,在输出窗口中我得到build命令:

  

C:\ Program Files(x86)\ MSBuild \ 12.0 \ bin \ Vbc.exe / noconfig   /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Generic,System.Data,System.Drawing,System.Diagnostics,System.Windows.Forms,System.Linq,System.Xml.Linq   / optioncompare:Binary / optionexplicit + / optionstrict:custom   / nowarn:41999,42016,42017,42018,42019,42020,42021,42022,42030,42032,42036,42104,42108,42109,42353,42354,42355   / optioninfer + / nostdlib / platform:x86 / removeintchecks-   / rootnamespace:INFOPRIM   /sdkpath:C:\Windows\Microsoft.NET\Framework\v2.0.50727 / highentropyva-   /doc:obj\Debug\INFOPRIM.xml   /定义: “CONFIG = \” 调试\ “DEBUG = -1,TRACE = -1,_MyType = \ ”WindowsForms \“,PLATFORM = \ ”AnyCPU \“”   /reference:C:\Windows\assembly\GAC\adodb\7.0.3300.0__b03f5f7f11d50a3a\adodb.dll,"C:\Program   文件(x86)\ SAP BusinessObjects \ Crystal Reports for .NET Framework   4.0 \ Common \ SAP BusinessObjects Enterprise XI 4.0 \ win32_x86 \ dotnet \ CrystalDecisions.CrystalReports.Engine.dll“,”C:\ Program   文件(x86)\ SAP BusinessObjects \ Crystal Reports for .NET Framework   4.0 \ Common \ SAP BusinessObjects Enterprise XI 4.0 \ win32_x86 \ dotnet \ CrystalDecisions.ReportAppServer.ClientDoc.dll“,”C:\ Program   文件(x86)\ SAP BusinessObjects \ Crystal Reports for .NET Framework   4.0 \ Common \ SAP BusinessObjects Enterprise XI 4.0 \ win32_x86 \ dotnet \ CrystalDecisions.ReportAppServer.Controllers.dll“,

等。还有更多。它是项目中的每个* .vb文件和资源。

我想知道它是否相当于:

  

devenv.exe MyProject.sln / build Debug / project“MyProject.vbproj”   / projectconfig Debug

因为我需要从命令行构建。

谢谢。

1 个答案:

答案 0 :(得分:4)

如果可能,对于自动构建,您应该使用MSBuild而不是Visual Studio。

msbuild MyProject.vbproj /t:Build /p:Configuration=Debug /verbosity:normal

(也可以安静,最小化和诊断)