ChrisFletcher
ChrisFletcher

Reputation: 1042

Compiling new .NET Core project unexpected dependency

I've just created a new .NET Core web app (all defaults, no webapi or web application) and I get the following error:

Unexpected dependency 'System.Runtime.CompilerServices.Unsafe' with no version number.

1>------ Build started: Project: WebApplication1, Configuration: Debug Any CPU ------ 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.PackageDependencyResolution.targets(154,5): error : Unexpected dependency 'System.Runtime.CompilerServices.Unsafe' with no version number.

1>WebApplication1 -> c:\users\chris\documents\visual studio 2017\Projects\WebApplication1\bin\Debug\netcoreapp1.1\WebApplication1.dll

1>Done building project "WebApplication1.csproj" -- FAILED.

========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

This is a recent install of VS2017 with .NET core installed as part of it. If I follow the error it takes me to the above targets and complaints the two items below are undefined:

enter image description here

UPDATE:

I've tried everything up to and including a full uninstall and reinstall of VS 2017. This seems to be only happening with the .NET Core 1.1 templates, (even with updated nuget packages)

Upvotes: 4

Views: 2356

Answers (1)

ChrisFletcher
ChrisFletcher

Reputation: 1042

Eventually solved the problem by clearing out my c:\users\myname\ .nuget\packages folder and doing a fresh dotnet restore. I assume it was picking up an old version of a package I had back when I was doing beta .net core development a long time ago

Upvotes: 4

Related Questions