{"id":18543,"date":"2015-03-18T12:53:00","date_gmt":"2015-03-18T12:53:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/dotnet\/2015\/03\/18\/msbuild-engine-is-now-open-source-on-github\/"},"modified":"2021-09-30T16:10:16","modified_gmt":"2021-09-30T23:10:16","slug":"msbuild-engine-is-now-open-source-on-github","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/msbuild-engine-is-now-open-source-on-github\/","title":{"rendered":"MSBuild Engine is now Open Source on GitHub"},"content":{"rendered":"<p>Today we are pleased to announce that <a href=\"https:\/\/github.com\/Microsoft\/msbuild\">MSBuild<\/a> is now available on <a href=\"https:\/\/github.com\/Microsoft\/msbuild\">GitHub<\/a> and we are contributing it to the <a href=\"http:\/\/www.dotnetfoundation.org\/\">.NET Foundation<\/a>! The <a href=\"https:\/\/github.com\/Microsoft\/msbuild\">Microsoft Build Engine (MSBuild)<\/a> is a platform for building applications. By invoking msbuild.exe on your project or solution file, you can orchestrate and build products in environments where Visual Studio isn&#8217;t installed. For instance, MSBuild is used to build the <a href=\"https:\/\/github.com\/dotnet\/corefx\">.NET Core Libraries<\/a> and <a href=\"https:\/\/github.com\/dotnet\/coreclr\">.NET Core Runtime<\/a> open source projects.<\/p>\n<p><a href=\"https:\/\/github.com\/microsoft\/msbuild\"><img decoding=\"async\" style=\"margin-right: auto;margin-left: auto\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2015\/03\/6710.msbuild-repo.png\" alt=\"\" border=\"0\" \/><\/a><\/p>\n<p>The MSBuild sources we&#8217;re publishing today are closely aligned with the version we will ship with Visual Studio 2015. You may notice a few differences as this is our first attempt at a standalone build, but you should see those discrepancies reduced over time. And keep in mind that for now, you&#8217;ll need to have <a href=\"http:\/\/www.visualstudio.com\/downloads\/visual-studio-2015-ctp-vs\">Visual Studio 2015<\/a> installed in order to build the first time.<\/p>\n<p>We will be adding Linux and Mac support soon (perhaps with your help!) so you can use MSBuild to build the open source .NET projects on your preferred platform. We&#8217;ll initially start with Mono and look to port the code to run on .NET Core. But we&#8217;re really just getting started on our ports. We wanted to open up the code first, so that we could all enjoy the cross-platform journey from the outset.<\/p>\n<h3>Walkthrough<\/h3>\n<p><strong>Build the Source Tree<\/strong><\/p>\n<p>The first scenario you might want to try is building the source tree. To do this, you will need to have Visual Studio 2015 installed on your machine. From a Developer Command Prompt, run the following:<\/p>\n<p><code>git clone https:\/\/github.com\/Microsoft\/msbuild.git<\/code><\/p>\n<p><code>cd msbuild <\/code><\/p>\n<p><code>build.cmd<\/code><\/p>\n<p><strong>Build a Console App<\/strong><\/p>\n<p>To build an app, you&#8217;ll first want to run the BuildAndCopy.cmd script we included in the root folder of the source. This will build the sources and create a copy of your build output with everything you need. Again from a Developer Command Prompt, run this command from your MSBuild source location: <code>BuildAndCopy.cmd binMSBuild true<\/code> Now, to build a simple .NET Core console application, try the following:<\/p>\n<p><code>cd .. <\/code><\/p>\n<p><code>git clone https:\/\/github.com\/dotnet\/corefxlab <\/code><\/p>\n<p><code>.msbuildbinMSBuildMSBuild.exe .corefxlabdemosCoreClrConsoleApplications<br \/>HelloWorldHelloWorld.csproj <\/code><\/p>\n<p><code>.corefxlabdemosCoreClrConsoleApplicationsHelloWorldbinDebugHelloWorld.exe<\/code><\/p>\n<p><img decoding=\"async\" style=\"margin-right: auto;margin-left: auto\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2015\/03\/6758.msbuild-hello-world.png\" alt=\"\" border=\"0\" \/><\/p>\n<h2>Summary<\/h2>\n<p>MSBuild is the default build engine for Visual Studio and the .NET community on the Windows platform. Through open sourcing MSBuild we are responding to community <a href=\"http:\/\/forums.dotnetfoundation.org\/t\/compiling-net-core-code-on-linux-os-x\/302\/3\">feedback<\/a> and we intend to make it the best choice for .NET developers on the Linux and Mac platforms.<\/p>\n<p>You can learn about the opportunities to get involved <a href=\"https:\/\/github.com\/Microsoft\/msbuild\/wiki\/Contributing%20Code\">here<\/a>. We look forward to your comments and hearing from you on the <a href=\"http:\/\/forums.dotnetfoundation.org\/\">.NET Foundation Forums<\/a>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today we are pleased to announce that MSBuild is now available on GitHub and we are contributing it to the .NET Foundation! The Microsoft Build Engine (MSBuild) is a platform for building applications. By invoking msbuild.exe on your project or solution file, you can orchestrate and build products in environments where Visual Studio isn&#8217;t installed. [&hellip;]<\/p>\n","protected":false},"author":336,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[685],"tags":[30,98,107],"class_list":["post-18543","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet","tag-announcement","tag-msbuild","tag-open-source"],"acf":[],"blog_post_summary":"<p>Today we are pleased to announce that MSBuild is now available on GitHub and we are contributing it to the .NET Foundation! The Microsoft Build Engine (MSBuild) is a platform for building applications. By invoking msbuild.exe on your project or solution file, you can orchestrate and build products in environments where Visual Studio isn&#8217;t installed. [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/18543","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/336"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=18543"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/18543\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=18543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=18543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=18543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}