I have a test project where I create a AppSelfHostBased for integration test and since moving from netcore3.1 to net5 I get in the OneTimeSetUp
System.TypeLoadException : Could not load type ‘Microsoft.Extensions.Primitives.InplaceStringBuilder’ from assembly ‘Microsoft.Extensions.Primitives, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60’.
The template project for ServiceStack works so is there no other solution to change sdk to sdk.web?
But you could forever be chasing transitive dependencies like this down, when your web integration tests could just be referencing <Project Sdk="Microsoft.NET.Sdk.Web">.
Well I went down the rabbit hole and realised I had a bit more than my services interfaces in the corresponding project. I had a left-over client referencing the http.polly extension
When I relocated it in an adequate project, all things went back to normal and my test library is back to referencing just sdk.