Add .NET 6 Support#403
Closed
jayharris wants to merge 5 commits intoivaylokenov:version-5.0from
Closed
Conversation
For AspNetCore 6, the implementation for IOptions<> changed from OptionsManager<> to UnnamedOptionsManager<>, an internal class.
Author
|
This PR does not support the new startup style that unifies |
|
Is this PR going to be merged soon, what is the plan? |
|
i think this project is dead TBH |
Collaborator
|
Resolved #405 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
DefaultActionDescriptorCollectionProviderwas 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
OptionsTestPluginservice 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 atMicrosoft.AspNetCore.Mvc.Versioningv5, since there is v6 release ofMicrosoft.AspNetCore.Mvc.Versioning.