I got this error today when trying to open a Visual Studio 2008 project in Visual Studio 2005:
The imported project \"C:\\Microsoft.C
For me the issue was that the path of the project contained %20 characters, because git added those instead of spaces when the repository was cloned. Another problem might be if the path to a package is too long.
In my case I could not load one out of 5 projects in my solution.
It helped to close Visual Studio and I had to delete Microsoft.Net.Compilers.1.3.2
nuget folder under packages
folder.
Afterwards, open your solution again and the project loaded as expected
Just to be sure, close all instances of VS before you delete the folder.
I deleted the obj folder and then the project loaded as expected.
Sometimes the problem might be with hardcoded VS version in .csproj file. If you have in your csproj something like this:
[...]\VisualStudio\v12.0\WebApplications\Microsoft.WebApplication.targets"
You should check if the number is correct (the reason it's wrong can be the project was created with another version of Visual Studio). If it's wrong, replace it with your current version of build tools OR use the VS variable:
[...]\VisualStudio\v$(VisualStudioVersion)\WebApplications\Microsoft.WebApplication.targets"
For errors with Microsoft.WebApplications.targets
, you can:
Microsoft.WebApplication.targets
” from development machine file to TFS build machine.Here's the post.
This is a global solution, not dependent on particular package or bin.
In my case, I removed Packages folder from my root directory.
Maybe it happens because of your packages are there but compiler is not finding it's reference. so remove older packages first and add new packages.
Steps to Add new packages
This is not proper solution, but I posted it here because I face same issue.
In my case, I wasn't even able to open my solution in visual studio and didn't get any help with other SO answers.