94

After installing Visual Studio 2017 Professional I can't build my ASP.NET Core in Visual Studio 2015 Professional anymore. I never opened this project in VS2017

I get

The following error occured attempting to run the project model server process (1.0.0-preview3-004056).

Unable to start the process. No executable found matching command dotnet-projectmodel-server

enter image description here

I then created a brand new ASP.NET Core project in Visual Studio 2015 and I get the exact same message when loading my project.

Additionally when I want to build the project I get

MSB1009: Project File does not exist.

enter image description here

The same problem does not occur with ASP.NET 5 projects so It's only limited to ASP.NET Core


Visual Studio 2017 7 March Update

Ifa global.json is added like in the answers below get an error message for any .net framework version used in the global.json and that exist in the C:\Program Files\dotnet\sdk\ folder

Error MSB4019 The imported project "C:\Program Files\dotnet\sdk\X.X.X\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

Also when closing Visual Studio and reopening it again I get the original error message

Community
  • 1
  • 1
dfmetro
  • 4,462
  • 8
  • 39
  • 65
  • 2
    Visual Studio 2017 updated the .NET Core SDK, which brought in quite a few changes, such as the move away from project.json and a number of optimizations towards the performance while working in Visual Studio. This is a breaking change in .NET core itself. – jessehouwing Nov 18 '16 at 10:26
  • I also installed VS 2017 RC on my machine that has VS 2015 update 3 and got the exact same error when trying to open an existing ASP.NET Core 1.0 app in VS 2015. This project opened just fine in VS 2015 before installing VS 2017 RC and I never tried opening it with VS 2017 RC. I uninstalled VS 2017 RC and the ASP.NET Core 1.0 app in opens just fine and builds now with VS 2015. So, apparently, contrary to what Microsoft says, you can't install VS 2017 RC on a machine that has VS 2015 on it. At least if you want to open ASP.NET Core 1.0 apps created with VS 2015 in VS 2015. – Stephen Peterson Nov 18 '16 at 15:57
  • 1
    Publishing is also broken with the default VS2017 ASP.NET Core RC template so I would advise to stay away until the RTM – dfmetro Nov 23 '16 at 14:38
  • Possible duplicate of [No executable found matching command dotnet-projectmodel-server](http://stackoverflow.com/questions/39391132/no-executable-found-matching-command-dotnet-projectmodel-server) – Rosberg Linhares Dec 09 '16 at 22:53
  • Not a duplicate as this is specific to VS 2017RC – dfmetro Dec 16 '16 at 08:35
  • There is an interresting thread about this on GitHub : https://github.com/aspnet/Tooling/issues/629 . Adding a global.json file in my project solved the problem in my case. – AdrienTorris Dec 27 '16 at 13:42
  • 2
    I found a workaround for your March 7th update with the missing Microsoft.DotNet.Props. Go to your `C:\Program Files\dotnet\sdk` folder and find the folder that was installed just before 1.0.0 (in my case `1.0.0-preview2-1-003177`). Replace sdk/version with that value in your global.json. Then `dotnet restore` – AngryHacker Mar 07 '17 at 22:42
  • @devc2 What I provided is merely a workaround. The underlying problem still needs to be fixed by Microsoft. – AngryHacker Mar 08 '17 at 07:17
  • @AngryHacker Thanks. I thought there was a way to run both old ASP.net COre Visual Studio 2015 projects and Visual Studio 2017 projects at the same time. I guess I will have to look at upgrading my old projects instead as it seem you cannot do both at the same time. – dfmetro Mar 08 '17 at 13:48
  • Same problem [here](http://stackoverflow.com/questions/42844245/net-core-error-msb4025-visual-studio-2015-package-restore) also `global.json` exits but that didn't resolve the issue. – Hussein Salman Mar 17 '17 at 14:35

5 Answers5

77

@ClaudioNunes and @MegaTron have the correct answer. After reading that answer, I realized my .NET Core solution did not have a global.json file. I added a new solution folder and added a global.json file. Since none of my projects are nested in sub folders, I only had to remove "src" and "test" from the projects array:

{
  "projects": [],
  "sdk": {
    "version": "1.0.0-preview2-003131"
  }
}

The project now opens correctly in VS 2015 with VS 2017 RC installed.

Community
  • 1
  • 1
Stephen Peterson
  • 1,135
  • 6
  • 7
  • Worked for me thanks. @Luiz would have gotten the answer as he was first but his answer wasn't detailed – dfmetro Nov 23 '16 at 14:35
  • Thank you. I was very confusion after upgraded to VS 2017 RC. But now it works. – thangchung Jan 15 '17 at 17:04
  • 2
    Aditionally I had to run `dotnet restore` on each project, but after that everything worked as expected. – cel sharp Jan 26 '17 at 10:56
  • 2
    What is this new solution folder you speak of? – Mathieu K. Mar 02 '17 at 18:00
  • I got two projects .NET core that failed after VS2017, but when create one "global.json" for each project, all works fine!! thanks – MarioAraya Mar 09 '17 at 16:22
  • Same problem [here](http://stackoverflow.com/questions/42844245/net-core-error-msb4025-visual-studio-2015-package-restore) also `global.json` exits – Hussein Salman Mar 17 '17 at 14:20
  • 1
    It did not worked with `"version": "1.0.0"` but when i tried `"version": "1.0.0-preview2-003131"` it worked.... Thanks for saving lifes... – Nisar Mar 22 '17 at 13:53
  • Important notice from @Nisar. There is also almost the same answer in official [dotnet docs](https://github.com/dotnet/cli/blob/rel/1.0.0/Documentation/ProjectJsonToCSProj.md#how-do-i-work-with-projectjson-and-csproj-on-the-same-machine) – resnyanskiy Mar 28 '17 at 06:18
  • @MathieuK., maybe you don't need to put this json file in any subfolder, at least I just had to put it in the root folder. Also, unloading and reloading the project afterwards did it for me. – gosr Aug 06 '17 at 13:20
  • It's explained here https://blogs.msdn.microsoft.com/dotnet/2017/08/14/announcing-net-core-2-0/ , go to "Relationship to .NET Core 1.0 and 1.1 Apps" section – PabloCocko Sep 02 '17 at 13:36
27

A possible workaround is to add a global.json to solution and specify the sdk version to be used as in

{
  "projects": [ "src", "test" ],
  "sdk": {
    "version": "1.0.0-preview2-003131"
  }
}
Roman Marusyk
  • 23,328
  • 24
  • 73
  • 116
Claudio Nunes
  • 371
  • 2
  • 2
5

Go to Programs and Resources, use "Core" to filter and find Preview 3 installation ("Microsoft .NET Core 1.0.1 - SDK Preview 3 (x64).") and remove it.

NOTE: Run dotnet --version before and after remove this SDK. On my case results in 1.0.0-preview3-004056(before) and 1.0.0-preview2-1-003177(after).

I can't see side effects on vs2017 yet.

  • 1
    That is one way to fix it, however, you can add a global.json file to your solution (solution file, not added at the project level) specifying the core version to use `{ "projects" : [], "sdk":{ "version":"1.0.0-preview2-003121"}}` – bougiefever Dec 04 '16 at 22:36
2

Take a look at this link: https://github.com/aspnet/Tooling/blob/master/known-issues-vs2017.md#known-issues-for-aspnet-core-support-in-visual-studio-2017

If you update the tooling for Visual Studio 2015 to the latest version, it should fix the issue. Note this is not the Visual Studio 2015 update, but the ASP.NET Core and tooling.

  • I'm not sure what installing the latest ASP.NET Core 1.1 tooling would have to do with opening a ASP.NET Core 1.0 app in VS 2015 and not having it work with VS 2017 RC installed. I can see if you wanted to upgrade your existing ASP.NET Core 1.0 app to 1.1, in VS 2015, but installing VS 2017 RC should have nothing to do with how VS 2015 works, especially with .NET Core projects created in VS 2015 – Stephen Peterson Nov 18 '16 at 21:39
0

The project upgrade has been improved from Visual Studio 2017 RC to Visual Studio 2017 RTM and is working now.

I ended up opening my Visual Studio 2015 ASP.NET Core Solution in Visual Studio 2017 which upgraded each project in the solution. I then updated the nuget packages and the solution worked without any side effects.

dfmetro
  • 4,462
  • 8
  • 39
  • 65