Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not resolve mscorlib for target framework '.NETFramework,Version=v4.6.1'

When I'm trying to update or configure service reference in .NET 4.6.1 project, VS throws next error:

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

Path lenght is OK, I'd also checked another answers on SO and nothing works. Maybe someone has something like that?

like image 205
Troll the Legacy Avatar asked Dec 17 '22 21:12

Troll the Legacy


1 Answers

I get the same error on VS2019.
This error occurred because I never restored nuget packages and built the solution.

After a restore of nuget packages and a full rebuild of the solution the error disappeared!

like image 56
Luca Ritossa Avatar answered Dec 26 '22 09:12

Luca Ritossa