4 ms·
Hoo boy, MSBuild was always by far my least-favorite part of being a .NET developer. I would like to flippantly say they should just throw it away and replace i
by serve_yay 11y ago
Hoo boy, MSBuild was always by far my least-favorite part of being a .NET developer. I would like to flippantly say they should just throw it away and replace it, but probably much too late for that.
- Someone1234 11y agoI have no strong opinions for or against MSBuild. What is it that you dislike about it? Or what is it that other tools do that MSBuild fails to do? PS - I have done a lot of .Net development, but rarely did anything beyond the basics with MSBuild directly (mostly via Visual Studio, or took the pre-generated command line and stuck in a script).
- duaneb 11y ago> PS - I have done a lot of .Net development, but rarely did anything beyond the basics with MSBuild directly (mostly via Visual Studio, or took the pre-generated command line and stuck in a script). This is an excellent reason to avoid MSBuild. IDE lockin is a nightmare. Might be unavoidable for Visual Studio, though.
- smacktoward 11y agoIf your priority is avoiding IDE lock-in and you have somehow ended up a Microsoft developer, you need to closely re-evaluate your life choices.
- radicalbyte 11y agoIt depends what you're doing. If you're making libraries, console applications or doing modern websites it's pretty easy to get your build working without Visual Studio. One - ELEPHANT SIZE - problem is that for some reason Microsoft only ship the Windows SDKs as part of Visual Studio. Meaning that you'll need to install the IDE at least once to get a build running (you can copy the SDKs around after that). Microsofties - I know that a lot of dev-div people will be reading - can you shed some light on this situation? What's the reasoning behind not shipping the SDKs separately. I've never had this problem with Java..
- Locke1689 11y agoDo you mean this[1] Windows SDK? [1] https://dev.windows.com/en-us/downloads/windows-10-sdk https://dev.windows.com/en-us/downloads/windows-10-sdk
- radicalbyte 11y agoFantastic, I hope they keep it up :) Previous SDKs have taken a long time to appear outside of VS :(
- wallyhs 11y agoFWIW, you can install MSBuild without Visual Studio. It's part of the Windows SDK. If your target system is not supported, you have to run it on a supported system and choose the "Download for installation on a separate computer" option. Then copy the resulting msi and cab files to the server and run them. See http://stackoverflow.com/questions/12944502/build-asp-net-4-5-without-visual-studio-on-build-server http://stackoverflow.com/questions/12944502/build-asp-net-4-... However, after I did this, I had to find build targets that Visual Studio installed and copy them from my workstation into the same directory on the server (i.e. C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications).
- radicalbyte 11y agoYup, that's how I make a build server: clean windows image, MSBuild, then copy the utils, build targets, reference assemblies etc over from a machine containing VS. It's such a pain that a famous ex-Microsoftie started a connect request for it: https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/5786689-support-net-builds-without-requiring-visual-studi https://visualstudio.uservoice.com/forums/121579-visual-stud...
- vpeters25 11y agoThis works fine until you have to build a project with a 3rd party commercial library requiring licenses (.licx files). I just spent a week trying to put together a vagrant vm to build such a project finally giving up and adding visual studio to its provisioning script.
- serve_yay 11y agoI really hated the language you use to describe build tasks. It is a very frustrating mix of declarative and imperative syntax. And of course, who wouldn't want to write code in XML?! (XML, the markup language, the one we use for marking up information like documents and records.) I was doing fairly complicated tasks with it years ago, and it's just one of those technologies that feels like it is fighting you at every turn. This was for continuous integration stuff and developer-productivity tools, not "open up Visual Studio and click the button". Thankfully much of that has been obviated over the years by things like NuGet and Octopus coming around.
- bdamm 11y agoI dislike maven for the same reason, but maven at least seems to have reasonable build structure.
- amyjess 11y agoMaven at least uses a declarative syntax, which is a sensible use of XML. Personally, I'd prefer JSON, but I've seen much worse use of XML. Imperative XML makes me choke.
- useerup 11y ago> I really hated the language you use to describe build tasks. Yup. For some reason that escapes rationality, MS chose to control the build through Workflow Foundation. And they build a horribly complicated WF "script". Pretty much universally hated. But you may be pleased to know that they have now abandoned that, and each build task can now be described pretty much by the scripting language of your choosing.
- serve_yay 11y agoAh, that is nice. .NET seems to have a wonderful property where even if they start out with something dumb, they eventually come to their senses and do the right thing. Sure can take a while to get there, though.
- 11y ago
- GFK_of_xmaspast 11y agoCmake will produce files that msbuild can operate on.
- bad_user 11y agoIt's not Maven.
- to3m 11y agoI hated it too. I don't recall a single good moment about using MSBuild. I never once felt like I'd figured it out, nor that I was getting to grips with it. But perhaps its brilliance was just beyond my ken. It was astoundingly verbose, rather poorly documented (I didn't think much of the official book either), extremely short on any kind of examples that might be usable with slight tweaks when you're getting started, and seemed to make unnecessarily heavy weather out of the simplest of tasks. Your debugging options are rather limited (especially if something goes wrong in one of your DLLs!), and I for one found the log files very hard to read. (On more than four occasions, I also lost a lot of source files after doing a build|clean. I never managed to finger MSBuild for this directly, but there aren't that many programs that are invoked on build|clean, and fewer yet that rely a filing system watcher to tell them which to delete, so I know where my suspicions lie.) I also have vague memories of finding out that only certain constructs could be made conditional, and that there were no facilities for abstracting conditions, making some of my files very repetitive and long-winded - but to be honest, at this point, I've blanked most of it.
- CmonDev 11y agoFork it and change it to your taste! Welcome to open source.