C# – Visual Studio 2015: Could not resolve mscorlib for target framework

cmscorlibvisual-studio-2015

I am trying to update a service reference but I'm getting the following error:

Could not resolve mscorlib for target framework '.NETFramework,Version=v4.0'.
This can happen if the target framework is not installed or if the framework
moniker is incorrectly formatted.

  • .NET v4.0 is installed.
  • Both "Update service Reference" and "Configure Service Reference"
    give the same error.

Best Answer

i opened the project file in a notepad editor and removed this.

Target Name="EnsureNuGetPackageBuildImports" /> bla bla bla