I'm new to the .NET ecosystem and am jumping in with F#, coming from Java-land. I'm trying to wrap my head around the tooling and build process.
My understanding is that MSBuild is the build tool for .NET applications, and that it's build configuration is defined in XML in a .sln and/or .*proj file. Am I correct in assuming that this is analogous to a pom.xml or build.gradle file in java?
Anyways, if MSBuild is the build tool, what exactly is FAKE for? What can FAKE do that MSBuild cannot? Is it just a more friendly 'wrapper' around MSBuild configuration files?
I came across a video titled Ionide and the State of F# Open Source Environment, and in it, the main presenter offers a reason why .*proj files are still needed in VSCode, at least. The following is not a direct quote, but near the end, he says something like
The MSBuild system is not needed at all in terms of communicating with the compiler and getting your code to work. The only reason we can't toally pull it out yet is because the F# compiler service - which provides the tooltip info, certain type of type checking, etc - depends on the project file, but we're working on expanding it so it can use different types of formats.
Visual Studio determines the build order and calls into MSBuild separately (as needed), all completely under Visual Studio's control. Another difference arises when MSBuild is invoked with a solution file, MSBuild parses the solution file, creates a standard XML input file, evaluates it, and executes it as a project.
The Microsoft Build Engine is a platform for building applications. This engine, which is also known as MSBuild, provides an XML schema for a project file that controls how the build platform processes and builds software.
For us, the major difference is that devenv will handle installer projects (*. vdproj) while msbuild will not.
MSBuild is a build tool that helps automate the process of creating a software product, including compiling the source code, packaging, testing, deployment and creating documentations. With MSBuild, it is possible to build Visual Studio projects and solutions without the Visual Studio IDE installed.
Well, the idea of Fake is that there is more to a build than just compilation. A typical Fake setup delegates the actual compilation to MSBuild, and takes care of the tasks that surround it: running tests, packaging, deploying, etc. While it is technically possible to do these things within MSBuild, its XML syntax and idiosyncrasies can make it a really painful experience. So it is generally best to keep the .*proj purely declarative (listing source files, references and properties) and to use Fake to describe the sequence of tasks that compose a build, where one of those tasks is to invoke MSBuild to perform the compilation.
As for why we still tend to use MSBuild as an intermediary instead of directly invoking the compiler from Fake, it's mostly because IDEs rely on .*proj as a project description format, and invoke MSBuild themselves when you click "Build", so we want to ensure consistency between compiling from IDE and building from the command line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With