I got this error today when trying to open a Visual Studio 2008 project in Visual Studio 2005:
The imported project "C:\Microsoft.CSharp.targets" was not found.
I got this error today when trying to open a Visual Studio 2008 project in Visual Studio 2005:
The imported project "C:\Microsoft.CSharp.targets" was not found.
In my case, I removed Packages folder from my root directory.
Steps to Add new packages
This is not proper solution, but I posted it here because I face same issue.
In my case, I can't even open my solution in visual studio and didn't get any help with above answers.
Open your csproj file in notepad (or notepad++) Find the line:
and change it to
This link on MSDN also helps a lot to understand the reason why it doesn't work. $(MSBuildToolsPath) is the path to Microsoft.Build.Engine v3.5 (inserted automatically in a project file when you create in VS2008). If you try to build your project for .Net 2.0, be sure that you changed this path to $(MSBuildBinPath) which is the path to Microsoft.Build.Engine v2.0.
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 underpackages
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 got this after reinstalling Windows. Visual Studio was installed, and I could see the Silverlight project type in the New Project window, but opening one didn't work. The solution was simple: I had to install the Silverlight Developer runtime and/or the Microsoft Silverlight 4 Tools for Visual Studio. This may seem stupid, but I overlooked it because I thought it should work, as the Silverlight project type was available.
Sometimes the problem might be with hardcoded VS version in .csproj file. If you have in your csproj something like this:
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: