Where using .netcore 2.2 an upgrade to .netcore 3.0
This is the error that we encounter when running unit test:
"Could not load type 'Context' from assembly 'Microsoft.AspNetCore.Hosting, Version=3.0.0.0"
These steps work on our project:
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Cors" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.2.0" />
Microsoft.AspNetCore.Mvc.Testing 3.0.0-preview7.19365.7
.AddApplicationPart(Assembly.Load("YourProjectControllerNamespace"))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With