.net5 => Could not load file or assembly System.Runtime, Version=6.0.0.0

458 views Asked by At

I have a solution with several WebAPI projects. All projects worked as needed, nothing changed in code. But one Monday (yesterday) I turned on my computer and tried to debug one of the project, which 100% worked before. But it failed with error

Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified

What is interesting - all WebAPIs use .net5, not .net6 (error refers to Version=6.0.0.0). No changes were made in code or project settings. Moreover, I downloaded repo from my vcs to another place, code which 100% worked before, and it also failed with the same error.

I asked my coleage to start debugging of the same WebAPI, with the latest Windows and Visual Studio updates - all worked.

I reinstalled .net5 SDK - nothing changed.

I repaired VisualStudio - nothin changed.

I even reinstalled Windows 11 (clear installation) - nothing changed.

And now I don’t know what else to do.

1

There are 1 answers

0
Dimitry On BEST ANSWER

Microsoft acknowledges that the problem exists and has provided a workaround - install the .net7 SDK (out of the blue!)