Not a subscriber?

Join thousands of others who are building self-directed lives through creativity, grit, and digital strategy—breaking free from the 9–5.
Receive one free message a week

Visual Studio Project MSBuild Import Error Fix

If you get this error:

Unable to read the project File <path.to.project>.csproj.

C:\<path>\<to>\<projecct>\Project.csproj 77, 11): The imported project “C:\Microsoft.CSharp.targets’ was not Found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

As shown in this screen shot …

image

 

Take a look at your project file. Open it in a text editor (such as NotePad++) and look for the import statement.

Mine looked like this:

clip_image001

 

How to fix

Change the MSBuild Property $(MSBuildToolsPath) to $(MSBuildBinPath) and the project should load.

Like so:

clip_image001[7]