I have an existing project, still referencing ServiceStack.Kestrel.Core v5.8.0, and Microsoft.AspNetCore.Server.Kestrel.Core v2.1.2, after installing .NET 5 I am getting the following Loader Exception when trrying to start an AppSelfHostBase:
Could not load type ‘Microsoft.Extensions.Primitives.InplaceStringBuilder’ from assembly 'Microsoft.Extensions.Primitives, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
I have tried uninstalling .NET 5 SDK but this issue remains, the application can continue to run if you ignore this error, but it is not able to return a Http Response, and so it looks like the application runs but all responses are invalid HTTP, and nothing can parse them.
Please could you look into this? Apart from moving to another dev environment I’m stuck here.
If this worked before installing .NET 5.0 I’d recommend pinning and running it against your previous .NET Core version by adding a global.json in the root directory of your solution.
You can find out the currently installed versions with:
$ dotnet --list-sdks
Grab the latest 3.x version and add it to a plain text global.json file, e.g:
global.json
{
"sdk": {
"version": "3.1.401"
}
}
The next time the App is run it will use the previous .NET Core 3.x runtime.
If you want to upgrade to .NET 5.0 make sure you’re using the latest ServiceStack v5.10.2 release then I’d perform a clean restore and build by removing the bin/ and obj/ folders of all projects.
If it’s still an issue can you put together a small stand-alone repro on GitHub and post the link here.