Microsoft.CSharp.Core.targets missing

doorman picture doorman · Nov 13, 2017 · Viewed 24.6k times · Source

I am building a webservice project on a TFS2017 Update 3 with build tools 2017. I get the following error

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.CSharp.CurrentVersion.targets(322,5): Error MSB4019: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Roslyn\Microsoft.CSharp.Core.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

What steps do I need to take to fix this error?

Answer

kenorb picture kenorb · Sep 18, 2018

In my case, opening the existing Solution file (with .sln extension), it installed all the missing dependencies.

Otherwise check for missing target packages at nuget.org manually and install them (e.g. MSBuild.Microsoft.VisualStudio.Web.targets).