Click here to Skip to main content
15,938,218 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
One of my net core 5 web apps has just given me this runtime error when I try to run it from Visual Studio 2019 Community

Could not load type 'System.Runtime.CompilerServices.DefaultInterpolatedStringHandler' from assembly 'System.Runtime, Version=

I can't see anything in my project that uses that assembly ? all was good until today Windows updates maybe ? I'm currently on the latest version of Win 10.

What I have tried:

Googled and all the usual stuff
If I build and run it from a Linux terminal there isn't a problem
BillWoodruff 2-Jan-22 12:01pm    
Is there any way you can examine the project file, or other app settings, to see if there is a valid reference to 'System.Runtime, Version= ?
pkfox 3-Jan-22 3:54am    
Hi Bill, thanks for replying - there is no reference to it in the .csproj file, but it is shown under Dependencies\Microsoft.NETCore.App which points to a physical file in C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.1\ref\net6.0\System.Runtime.dll - but that file is dated 23/11/2021
BillWoodruff 4-Jan-22 10:41am    
Sorry, that's the only thing i can think of ... one way to check that might be to look for some other call to that librarys facilities and see if that, also, breaks ?
Maciej Los 12-Jan-22 15:29pm    
I'd suggest to close VS, delete hidden folder .vs, open project and build project again.

1 solution

This problem has come up for me when the same project has two branches, one using Dot Net 5 and the other using Dot Net 8. I was able to resolve this strange behavior by cleaning up and rebuilding the solution.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900