使用 MSBuild 有哪些优点?
我的经理强迫我使用 MSBuild 来构建我的应用程序。
我在 ASP.NET MVC 中开发了我的应用程序。
我有一些问题:
- MSBuild 有哪些优点?
- 还有比 MSBuild 更好的其他构建工具吗?
- 简单构建项目有哪些缺点?
My manager is forcing me to use MSBuild for building my application.
I developed my application in ASP.NET MVC.
Here are some questions I have:
- what are the advantages of MSBuild?
- Is there any other build tool better than MSBuild?
- What are the drawbacks on simple build of projects?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
MSBuild 很棒。它在概念上与 NAnt 类似,但其某些任务或实现略有不同。
一旦习惯了,您就可以编写构建文件了。看一下 csproj 文件 - 它是一个 MSBuild 文件(请注意,.sln 解决方案文件与 MSBuild 文件非常相似,但从技术上讲它还不是 MSBuild 文件)*。为其构建自定义任务非常简单,互联网上有很多指南可以引导您完成操作。
如果你正在寻找替代方案,那么我会去 NAnt。它是免费的,并且有大量的社区支持和额外的任务可用。不过我已经有几年没有使用它了,所以目前我无法评论它的确切状态。
使用 MSBuild 并没有真正的缺点,除非您计算了加快速度所需的时间以及必须花费的时间来研究它。
从你的问题来看,听起来你确实没有太多的构建过程 - 花点时间去做,一旦你有了,你会想知道为什么不早点做。
* 编辑以回应 Sayed Ibrahim Hashimi 的评论
MSBuild is great. It is similar in concept to NAnt, but slightly different with some of its tasks or implementations.
Once you get used to it, you will be cranking out the build files. Take a look at a csproj file - it is a MSBuild file (note that the .sln solution file is very similar to an MSBuild file but it technically isn't a MSBuild file (yet))*. Building custom tasks for it is very simple, there are plenty of guides on teh interweb which walk you through how to do it.
If you are looking for alternatives, then i would go to NAnt. It is free, and has a huge amount of community support and extra tasks available. I haven't used it for a few years though, so i can't comment on its exact state at the moment.
There are no real drawbacks to using MSBuild, unless you count the amount of time it will take to get up to speed with it, and the amount of time you have to spend researching it.
From your questions it sounds like you don't really have much of a build process in place - take the time to do it, once you have you will wonder why you didn't do it sooner.
* Edited in response to comment from Sayed Ibrahim Hashimi
MSBuild 的优点:
缺点: XML 语法可能不直观。
Advantages with MSBuild:
Drawback: Well, the XML syntax may not be intuitive.