cidthecoatrack
cidthecoatrack

Reputation: 1441

DotNetCore build fails because Microsoft.DotNet.Props is missing

I am building a dotnetcore project using Microsoft.NETCore.App version 1.1.0. I had tried updating to 1.1.1, but our project uses NUnit, which is not yet fully supported in 1.1.1. So, I had to roll it back. However, as part of the update, I had to install the .Net Core app of 1.1.1. After rolling back, I re-installed 1.1.0, and I still get the following error when I build:

Error   MSB4019 The imported project "C:\Program Files\dotnet\sdk\1.0.1\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.

I looked in the file directory for all versions of the sdk that I have installed, and none of them have that directory. This worked until my attempt to update this morning. I am not sure why it still fails after reinstalling the older version of .Net Core. This is a blocker for me, as it prevents me from building and finishing a feature for an API. Any help is much appreciated.

Update: The obvious answer is to move the project to VS2017, but unfortunately that is not currently an option, as our project uses NUnit for testing, which is not yet fully supported in VS2017 and dotnetcore.

Upvotes: 4

Views: 3103

Answers (1)

natemcmaster
natemcmaster

Reputation: 26823

To continue using xproj and project.json, you must only use Visual Studio 2015 and .NET Core CLI preview 2. Run dotnet--info to figure out which version of .NET Core CLI you have. You must use a version that starts with "1.0.0-preview2". Anything newer does not support xproj or project.json.

If you have multiple versions of .NET Core CLI installed, executing "dotnet.exe" will use the latest version by default. You can control this by adding a file named "global.json" to your project and setting the SDK version in it. Example:

{
  "sdk": { "version": "1.0.0-preview2-003131" }
}

Upvotes: 5

Related Questions