Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft.CSharp.Core.targets missing

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?

like image 465
doorman Avatar asked Nov 13 '17 08:11

doorman


2 Answers

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).

like image 171
kenorb Avatar answered Sep 23 '22 16:09

kenorb


If you're coming to this page from google/duckduckgo after trying to figure out why you're getting a similar message in Ubuntu 20.04, maybe this can help: https://askubuntu.com/a/1231973/1073658 (tl;dr apt install mono-roslyn from mono-project's repo)

like image 21
vydd Avatar answered Sep 20 '22 16:09

vydd