Is it worth learning to use MSBuild?

前端 未结 10 2075
清酒与你
清酒与你 2021-02-18 15:20

I simply wondered whether people thought it was worth learning to use the MSBuild syntax in order to customise the build process for a .net project, or whether it is really not

相关标签:
10条回答
  • 2021-02-18 15:57

    @kronoz I would say YES. The neat thing about MSBuild is that if you modify your csproj files to include custom build steps then those steps will happen from within VS or from MSBuild. Also if you ever have a build server you will not need to install full VS, only the SDK to build your projects.

    ==> This is not entirely true. For example, building a setup project on a build server will require Visual studio to be installed!!

    0 讨论(0)
  • 2021-02-18 16:00

    In a scenario such as yours, where you do not already have a build system, then yes, MSBuild is absolutely worth it. Not only can you use it for a variety of pre-build and post-build tasks (see Jicko Petiov's answer), but you can also integrate it nicely into a continuous integration environment (such as CruiseControl).

    One scenario where it might not be worth it is when you already have an automated/scripted build system in place. For example, I myself haven't taken the time with MSBuild because I've been using NAnt for this task since before MSBuild existed ...

    0 讨论(0)
  • 2021-02-18 16:11

    MSBuild is definitely worth learning for anyone and everyone writing .NET software. The reason a build server for .NET apps no longer requires Visual Studio to be installed (as Andrew Burns mentioned) is because MSBuild is part of the .NET Framework now.

    Knowing MSBuild will give you significant flexibility in choosing what technologies you use to implement continuous integration. Because I took the time to learn MSBuild, I was able to change the CI system one of our teams was using from CruiseControl.NET to TeamCity without much difficulty. Those CI servers, or something like FinalBuilder (which I'm not familiar with), are better options for performing nightly builds than a scheduled task. Learning how to implement custom MSBuild tasks will give you even more flexibility in implementing custom builds. Jivko Petiov listed a number of tasks that MSBuild makes easier. In the case of database deployment and configuration, I've written scripts that do this in MSBuild, and it makes the development and testing process much easier.

    If Visual Studio Team System is in your future, applications built using MSBuild will be much easier to move into that environment than those built via alternative means.

    There are a lot of resources available to help you get started with MSBuild. I'd start with Inside the Microsoft Build Engine. One of the co-authors also has a ton of stuff on the web, including this site, and a project on CodePlex.

    0 讨论(0)
  • 2021-02-18 16:11

    Well, MSBuild is built in, so if you are doing something simple, then yes, it is recommended.

    But for something like nightly builds, I would suggest FinalBuilder.

    See this question on Build/Configuration Management Tools.

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