sdk: Microsoft.DotNet.Props was not found
Steps to reproduce
Build MusicStore sample
Expected behavior
No error
Actual behavior
C:\temp\MusicStore-dev\samples\MusicStore>dotnet build Microsoft ® Build Engine version 15.1.0.0 Copyright © Microsoft Corporation. All rights reserved.
Build started 11/11/2016 10:13:07 AM. 1>Project “C:\temp\MusicStore-dev\samples\MusicStore\MusicStore.xproj” on node 1 (Build target(s)). 1>C:\temp\MusicStore-dev\samples\MusicStore\MusicStore.xproj(7,3): error MSB4019: The imported project “C:\Program Files (x86)\dotnet\sdk\1.0.0-preview4-004071\Extensions\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 exists on disk. 1>Done Building Project “C:\temp\MusicStore-dev\samples\MusicStore\MusicStore.xproj” (Build target(s)) – FAILED.
Build FAILED.
"C:\temp\MusicStore-dev\samples\MusicStore\MusicStore.xproj" (Build target) (1) ->
C:\temp\MusicStore-dev\samples\MusicStore\MusicStore.xproj(7,3): error MSB4019: The imported project "C:\Program Files (x86)\dotnet\sdk\1.0.0-preview4-004071\Extensions\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 exists on disk.
0 Warning(s)
1 Error(s)## Environment data
dotnet --info
output:
C:\temp\MusicStore-dev\samples\MusicStore>dotnet --info
.NET Command Line Tools (1.0.0-preview4-004071)
Product Information: Version: 1.0.0-preview4-004071 Commit SHA-1 hash: 9855dc0088
Runtime Environment: OS Name: Windows OS Version: 10.0.14393 OS Platform: Windows RID: win10-x86
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 31 (5 by maintainers)
@theShiva my guess is that you installed a new CLI (1.0.1) and you are trying to open a project without global.json pinning the version of the CLI to what you need for VS2015 (preview2). So, add a global.json to the root of your repo, with
Basically, VS2015 only works with CLI preview2. VS2017 needs at least CLI 1.0.0.
Hi, something like that works for me:
global.json file
My sdk directory:
You can download the sdk from this page: https://github.com/dotnet/core/blob/master/release-notes/download-archives/1.1-preview2.1-download.md
Okay so I just had this issue which stumped me for a few days. I was downloading the latest SDK from Microsoft (1.0.3) and using the global.json as specified here but, I needed to use preview, in my case and not the latest and it worked!
Hope it helps someone.
@liuzexiazbx in folder where you have sln file, create global.json file with content described above by @livarcocc , eg:
Update – I actually got it to work. I had to delete all other versions of dotnet from my
/usr/local/share/dotnet
and its subdirectories (on macOS).I’m using dotnet CLI 1.0.1, with .NET Core 1.0.3 SDK Preview 2 build 3156, and have a
global.json
file similar to @mharasimowiczcontrolexpert’s above, but am getting this error:This is my
global.json
:Am I to understand that I cannot get past this error unless I upgrade to .NET Core 1.1.0 SDK Preview 2.1 build 3177?
Thanks.
None of this is working for me. Is there a valid instruction page that someone can share? I just wonder when will Microsoft start producing something other than garbage?
thanks you for reply.I have done with above,
.but still wrong
Have you migrated this project to csproj? The msbuild based CLI does not support xproj. If you migrate your projet, we will create an equivalent csproj for it and move your project.json and xproj to a backup folder.
Please, re-activate if that doesn’t solve your problem.