MyTested.AspNetCore.Mvc
MyTested.AspNetCore.Mvc copied to clipboard
Add .NET 6 Support
Revised all projects to build with .NET 6 and use AspNetCore v6 / EF Core v6 packages. Addressed issues within the codebase so that all unit tests pass.
About 100 unit tests were broken, including most within Options, EFCore, Samples, and Razor Compiler Services.
Compiler Services and all Samples were resolved by adding a NullFileProvider to the ContentRootFileProvider property within the host environment. Several of these tests were failing because DefaultActionDescriptorCollectionProvider
was throwing a NullReferenceException when trying to access its own FileProvider, which defaults to the ContentRootFileProvider (which wasn't getting set).
EFCore tests were breaking on double-registered DbContextImplementation, resolved by changing to TryAddScope instead of AddScope. TryAddScope is a no-op if already registered.
Options was failing on the OptionsTestPlugin
service selector; the implementation for IOptions<> changed from OptionsManager<> to the new UnnamedOptionsManager<> in AspNetCore 6. However, UnnamedOptionsManager is an internal class, so the plugin's service selector is doing a comparison on Type.FullName, rather than a strongly-typed comparison to Type.
Note: One project, MyTested.AspNetCore.Mvc.Versioning
, remains at Microsoft.AspNetCore.Mvc.Versioning
v5, since there is v6 release of Microsoft.AspNetCore.Mvc.Versioning
.
This PR does not support the new startup style that unifies Program.cs
with Startup.cs
and eliminates the Configure
and ConfigureServices
methods (https://docs.microsoft.com/en-us/aspnet/core/fundamentals/startup?view=aspnetcore-6.0). This PR focuses on existing applications that have been upgraded to .NET 6, rather than new applications that were created from a .NET 6 template.
Is this PR going to be merged soon, what is the plan?
i think this project is dead TBH the OC stated in an issue that he is barely touching this now
Resolved #405