The accepted answer is a workaround, not a solution. You need to open the .csproj
file for editing in a text editor and ensure the following line is present in there
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
If not add it to the end.
Note: For VS2008, this may be $(MSBuildToolsPath)