Visual Studio 2015: Could not resolve mscorlib for target framework

gizemdemirel picture gizemdemirel · May 2, 2017 · Viewed 8.3k times · Source

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.

Answer

user704401 picture user704401 · Aug 8, 2019

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

Target Name="EnsureNuGetPackageBuildImports" /> bla bla bla