{"id":178,"date":"2016-11-20T09:45:29","date_gmt":"2016-11-20T09:45:29","guid":{"rendered":"http:\/\/blog.catalystlogic.com.au\/?p=178"},"modified":"2026-03-01T01:44:18","modified_gmt":"2026-02-28T14:44:18","slug":"vs2017-rc-asp-net-core-on-linux","status":"publish","type":"post","link":"http:\/\/54.253.247.134\/?p=178","title":{"rendered":"VS2017 RC &#038; ASP.Net .Core on Linux"},"content":{"rendered":"<h3>VS2017RC Tooling on Linux<\/h3>\n<p>What better way to try out VS2017 RC, by creating a .Net Core solution on windows, and building it on linux.<\/p>\n<p>However the standard<a href=\"https:\/\/www.microsoft.com\/net\/core#linuxredhat\" target=\"_blank\" rel=\"noopener noreferrer\"> .Net core installation guide for Linux<\/a>, as of the date of this post, will not build VS2017 RC projects, due to it utilising&nbsp;*.csproj&nbsp;files, and no longer creating xproj \/&nbsp;project.json files.<\/p>\n<p>Expect an&nbsp;error along the&nbsp;lines of:<\/p>\n<pre class=\"lang:sh decode:true\">[user@localhost]$ dotnet run\nThe current project is not valid because of the following errors:\n\/home\/user\/DotNetCoreASP(1,0): error DOTNET1017: Project file does not exist '\/home\/user\/DotNetCoreASP\/project.json'.\n<\/pre>\n<p>A version check&nbsp;will show that the \"latest\" is quite on the bleeding edge as it needs to be.<\/p>\n<pre class=\"lang:sh decode:true\">[user@localhost \/opt\/dotnet]$ dotnet --version\n1.0.0-preview2-1-003177\n<\/pre>\n<p>Compare this to Powershell&nbsp;after a VS2017 .Net Core install in the windows box.<\/p>\n<pre class=\"lang:ps decode:true \">PS C:\\&gt; dotnet --version\n1.0.0-preview3-004056<\/pre>\n<p>Initially, the only option looked to be&nbsp;<a href=\"https:\/\/github.com\/dotnet\/cli\/tree\/rel\/1.0.0-preview3\" target=\"_blank\" rel=\"noopener noreferrer\">building from the preview branch in git.<\/a><\/p>\n<p>However, there is a series of preview binaries available for those looking to hit the ground running faster.<\/p>\n<p><a href=\"https:\/\/github.com\/dotnet\/core\/blob\/master\/release-notes\/preview3-download.md\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/github.com\/dotnet\/core\/blob\/master\/release-notes\/preview3-download.md<\/a><\/p>\n<p>Howover, that is waye tyopo&nbsp;easy.<\/p>\n<h4>Building the .Net CLI in Linux<\/h4>\n<p>Let's build us the .Net CLI.<\/p>\n<p>After a git&nbsp;clone, switch to the preview 3 branch.<\/p>\n<pre class=\"lang:sh decode:true \">git checkout -b re1\/1.0.0.0-preview3\n<\/pre>\n<p>Initally, it's going to take a while, the bash that kicks it all off is &nbsp;\/build.sh<\/p>\n<p>The scripts go&nbsp;three to&nbsp;four deep ,at least. Adding a set -x to the top level script next to the existing set -e will give us some visibility into how the build is going.<\/p>\n<pre class=\"lang:sh decode:true\">#!\/usr\/bin\/env bash\n#\n# Copyright (c) .NET Foundation and contributors. All rights reserved.\n# Licensed under the MIT license. See LICENSE file in the project root for full license information.\n#\n\n# Set OFFLINE environment variable to build offline\n\nset -e\n# Enable recursive debugging for verbose output\nset -x\n\nSOURCE=\"${BASH_SOURCE[0]}\"\n...<\/pre>\n<h4>Post Build<\/h4>\n<p>Once built&nbsp;set up a new symlink. As it will be to the same executable, dotnet,&nbsp;create it in a subfolder to \/user\/local\/bin, and then remove it, and remove the folder.<\/p>\n<pre class=\"lang:sh decode:true\">sudo mkdir \/usr\/local\/bin\/dotnet-preview3-dir\nsudo ln -s \/home\/user\/dev\/cli\/artifacts\/centos.7-x64\/stage2\/dotnet \/usr\/local\/bin\/dotnet-preview3-dir\nsudo mv \/usr\/local\/bin\/dotnet-preview3-dir\/dotnet \/usr\/local\/bin\/dotnet-preview3\nsudo rm \/usr\/local\/bin\/dotnet-preview3-dir -r<\/pre>\n<p>You can then have a stable binary, and a build version running side by side.<\/p>\n<h3>Troubleshooting<\/h3>\n<p>One nasty looking error I bumped into was this one, in red, making&nbsp;it extra ominous.<\/p>\n<pre class=\"lang:sh decode:true\">$ dotnet run\n\/opt\/dotnet\/sdk\/1.0.0-preview3-004056\/Microsoft.Common.CurrentVersion.targets(1107,5): error MSB3644: The reference assemblies for framework \".NETFramework,Version=v4.0\" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [\/home\/user\/DotNetCore\/hwapp\/hwapp.csproj]\n\nThe build failed. Please fix the build errors and run again.<\/pre>\n<p>Let see, its mention Net 4.0, and a GAC&lt; on a LInux bo-x that is running .Net Core.<\/p>\n<p>Not looking good. There are no .Net 4.0 References in the project&nbsp;and the whole point of .Net Core is to stand alone with a dependency on Mono. As for the GAC reference, this message doesn't&nbsp;give is much to go on.<\/p>\n<p>Until you realise all you need to&nbsp;do is&nbsp;restore&nbsp;the project.<\/p>\n<pre class=\"lang:sh decode:true\">dotnet restore<\/pre>\n<p>It does show that while the base cross-platform&nbsp;functionality&nbsp;is there,&nbsp;removing the legacy windows reference is going to be some time&nbsp;away for this fledgeling framework.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>VS2017RC Tooling on Linux What better way to try out VS2017 RC, by creating a .Net Core solution on windows, and building it on linux. However the standard .Net core installation guide for Linux, as of the date of this post, will not build VS2017 RC projects, due to it utilising&nbsp;*.csproj&nbsp;files, and no longer creating <a class=\"read-more\" href=\"http:\/\/54.253.247.134\/?p=178\">...continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,13,18],"tags":[21],"class_list":["post-178","post","type-post","status-publish","format-standard","hentry","category-net","category-linux","category-visual-studio","tag-net-core"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/54.253.247.134\/index.php?rest_route=\/wp\/v2\/posts\/178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/54.253.247.134\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/54.253.247.134\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/54.253.247.134\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/54.253.247.134\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=178"}],"version-history":[{"count":1,"href":"http:\/\/54.253.247.134\/index.php?rest_route=\/wp\/v2\/posts\/178\/revisions"}],"predecessor-version":[{"id":222,"href":"http:\/\/54.253.247.134\/index.php?rest_route=\/wp\/v2\/posts\/178\/revisions\/222"}],"wp:attachment":[{"href":"http:\/\/54.253.247.134\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/54.253.247.134\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=178"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/54.253.247.134\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}