94

I have some error while loading the .net project solution. the error will be like

The imported project "C:\Program Files(x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" was not found.Confirm that the path in the <Import> declaration is correct, and that the file exist on disk.

How to solve this problem?

1
  • 4
    Like @MuazzamAli says below, this started happening for me after I install Visual Studio 2017 and then going back to opening a project with Visual Studio 2015.
    – jmbmage
    Commented Apr 4, 2017 at 13:44

7 Answers 7

126

Although this question has already been answered. I recently came across the same issue. The more specific answer is that you need to install the Visual Studio 2015 Tools (Preview 2):

https://www.microsoft.com/net/download/core

Direct Download:

https://go.microsoft.com/fwlink/?LinkId=827546

Because this wasn't straight forward and I was working on a 1.1 dotnet core project, I accidentally skipped this step and only installed the Windows SDK. I reported an issue here:

https://github.com/dotnet/core/issues/378

3
  • 11
    Thanks for this. If you have VS2017, you must also edit your globals.json to specify "sdk": { "version": "1.0.0-preview2-003121" } Otherwise the xproj will try to use the release version of tools which doesn't support xproj (unlike the preview2 version which does). See github.com/dotnet/cli/blob/rel/1.0.0/Documentation/… Commented Mar 10, 2017 at 20:42
  • 2
    @JaredMoore it should be global.json instead of globals.json (github.com/dotnet/cli/issues/4683)
    – samAlvin
    Commented Jun 23, 2017 at 6:19
  • 2
    Just an addition, the Visual Studio 2015 Tools (Preview 2) needs the Visual Studio 2015 Update 3 to be installed first. Here is a direct download link in case someone needs it: Visual Studio 2015 Update 3
    – Leo
    Commented Jul 25, 2017 at 16:04
20

You need to install Microsoft .NET Core 1.0.1 tooling preview (the current one is Preview 2).

2
  • Do you have a link?
    – Andreas
    Commented Mar 13, 2017 at 13:03
  • 3
    I did not include any links on purpose as the .NET Core tooling is being updated so often that links would point to the outdated version. AFAIK, VS2017 includes all necessary .NET Core tools, so, there is no need for a separate tooling installation. Commented Mar 14, 2017 at 4:30
13

If you've recently installed VS 2017 and you get this error and your project was using project.json, it's probably that you have to upgrade your solution to csproj rather than the old project.json format. If you open the project in vs2017 it should upgrade it automatically. Check out this article if you need more info Project-json to csproj

2
  • 4
    I've upgraded two projects so far, but for some reason the migration tool doesn't rename .xproj to .csproj in the .sln file. I manually made this change and the project then loads successfully.
    – Mark G
    Commented Mar 10, 2017 at 1:19
  • @MarkG: Add "rename .xproj to .csproj in the .sln file" as a separate answer, it fixed my issue Commented May 16, 2017 at 5:28
6

Option 1:

Install DotNetCore.1.0.1-VS2015Tools.Preview2.0.3. You can stay in xproj.

Option 2:

Install Visual Studio 2017 and auto upgrade from xproj to csproj.

Option 3:

Follow below steps to upgrade from xproj to csproj and to stay in Visual Studio 2015.

Warning: Using the below process you will not be able to use VS2015 to Load PCM web. Instead you have to stick and work with DOTNET CLI (Command Line Prompt) or VSCode IDE

Step 1: Download and Install .NET Core from this link https://www.microsoft.com/net/download/core

Step 2: Go to global.json. Modify version number to version installed in PC (for my pc it is 1.0.1).

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

New:
{
  "projects": [ ""Source" ],
  "sdk": { "version": "1.0.1-*" }
}

Step 3: Goto Command Prompt as administrator and run command

dotnet migrate
dotnet restore
dotnet build
dotnet run
4

It seems that Microsoft entirely rejiggled the solution structure in VS2017... That's how I resolved the issue in VS2017:

  • Opened the .sln file
  • In the "Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = 'NNN', 'NNN.xproj'... " line - replaced the "NNN.xproj" with the "NNN.csproj", and... vuala!

hope it helps.

1
  • This helped me to open a VS2015 project in VS 2017. Thank you
    – myro
    Commented Apr 28, 2017 at 8:48
4

I know that i am quite late to the party, but as someone who has run into these problems time and again, these 2 articles really helped me in understanding why those issues happened in the first place and how to fix them.

a brief update about my current setup: i had both VS2015 and VS2017 installed. I was using VS2015 with .net Core SDK 1.0.0-preview2-003133, which contains .Net Core 1.0.1. Upon installing VS 2017, it automatically installed .Net Core 1.1.0 and set that as the default .Net Core version on my PC, which led to all the problems.

hopefully others would find it useful too :)

no executable found matching command dotnet projectmodel server

developing two versions net core sdk side

2

I ran into this issue after I installed VS2017 community edition. This is how I resolved the issue: Go to this folder: C:\Program Files\dotnet\sdk Find the folder named: 1.0.0 and rename it to xx.xx.xx

For some reason VS2015 switch back (or default to ) to this folder after VS2017 is installed so renaming it forces VS2015 to look in other folders. This is what I have in my global.json: "sdk": { "version": "1.0.0-preview2-003131" }

Updated: You will have to change the folder name back to 1.0.0 when you switch over to VS2017. I had to rename it back to migrate my vs2015 .Net Core solution to 2017.

1
  • I also had this problem after installing VS2017 and trying to go back to opening projects with VS2015.
    – jmbmage
    Commented Apr 4, 2017 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.