Integrating MSBuild into Visual Studio

后端 未结 10 1610
陌清茗
陌清茗 2021-02-02 11:03

I\'m a solo developer running Visual Studio 2008 and looking into MSBuild to improve my build process.

Almost all of the tutorials I\'ve found so far have plenty of info

相关标签:
10条回答
  • 2021-02-02 11:42

    This is an older article about some simple extension points from the msbuild team

    How To: Insert Custom Process at Specific Points During Build

    0 讨论(0)
  • 2021-02-02 11:43

    I'd suggest you call msbuild as a post build step. Then you can put your build script somewhere in your solution and call it.

    <windowsdir>\Microsoft.NET\Framework\v3.5\MSBuild.exe c:\temp\MyProject\mybuildfile.proj
    
    0 讨论(0)
  • 2021-02-02 11:45

    As others have noted, MSBuild is already available when you install Visual Studio.

    If you want to integrate into VS2008: Running MSBuild from Visual Studio

    0 讨论(0)
  • 2021-02-02 11:45

    I use the msbuild template to intergrate with visual studio

    http://msbuildtemplate.codeplex.com/

    0 讨论(0)
  • 2021-02-02 11:47

    Visual Studio executes MSBuild automatically for projects it supports.

    If you right click on a project and unload it, you can then edit it in Visual Studio. Reload (right click on project again), force a (re)build to test your changes. An alternative is to edit the project file in an external editor and Visual Studio will detect saves and offer to reload the project for you.

    Sounds like you're on the right track, and if you are considering writing Targets or custom MSBuild Tasks, take the time to separate them from your current project so that you can re-use them. Don't re-invent the wheel though, the two main complementary MSBuild projects are MSBuild Community Tasks and MSBuild Extension Pack.

    Update: Judging from your comment on Mitch's answer, you might also want to consider adding a new Configuration element or custom properties to a project. A new MSBuild Configuration (something other than the default Debug/Release) could run unit tests, build documentation, or whatever you want automated. A custom MSBuild property would allow you to use normal Debug/Release Configuration and extend it to automate more of your build process, just depends on what you want. Either approach could also be driven from the command line.

    0 讨论(0)
  • 2021-02-02 11:48

    You can use your current .vcproj files to build your project with MSBuild. However, as MSBuild is not directly supported (at least for vc++) vcbuild is used instead (internally). In VS2010 all project files are MSBuild based...

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