Compiling a .vbproj or .csproj project file without Visual Studio

前端 未结 6 1990
梦谈多话
梦谈多话 2020-12-29 23:47

Is there a way to compile a .vbproj or .csproj project file directly, just like Visual Studio does?

When you compile in Visual Studio, the \"output\" window shows th

相关标签:
6条回答
  • 2020-12-30 00:24

    Just so you know .vbproj and .csproj files are MSBuild. So everything that you've read, you can apply to those files directly.

    Sayed Ibrahim Hashimi

    My Book: Inside the Microsoft Build Engine : Using MSBuild and Team Foundation Build

    0 讨论(0)
  • 2020-12-30 00:26

    At the top of a .vbproj file is a . Add this line to the property group to suppress the VB runtime:

    <NoVBRuntimeReference>On</NoVBRuntimeReference>
    

    MSBuild does the rest. No need to use the command line if you have the IDE.

    0 讨论(0)
  • 2020-12-30 00:31

    In project solution folder:

    msbuild wpfapp1.sln /p:BuildProjectReferences=true
    

    MSbuild is usually located in:

    C:\Windows\Microsoft.NET\Framework64\v4.0.30319
    

    (or something similar, depending on the version)

    csc.exe compiles files, msbuild compiles projects and solutions

    0 讨论(0)
  • 2020-12-30 00:33

    MSBuild is the easiest way to go. For instance:

    msbuild /property:Configuration=Release MyFile.vbproj
    
    0 讨论(0)
  • 2020-12-30 00:36

    MSBuild can also take your solution file and use it to do the compile.

    0 讨论(0)
  • 2020-12-30 00:42

    You can use either MSBUILD or CSC. MSBuild, which as you mentioned, does use your project and solution files. CSC will compile specific files, or all files in a specific directory tree.

    You should also look at automating your builds with NAnt and/or CruiseControl.net.

    Also, here is an example on how to compile your code without visual studio using CSC. http://blog.slickedit.com/?p=163

    0 讨论(0)
提交回复
热议问题