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

Troll the Legacy picture Troll the Legacy · Aug 7, 2018 · Viewed 7.9k times · Source

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?

Answer

Paul Schroeder picture Paul Schroeder · Sep 25, 2018

It is hard to confirm, but I believe my issue had to do with exceeding a TFS limit of 259 characters in the path. In short, when getting latest from TFS, I think some files were not downloading to my local machine due to their path exceeding 259 characters.

After renaming the working directory to a shorter path, I was able to configure existing and new service references. Here's one link discussing the limitation: TFS Path Too Long Problems