Skip to content

Add .NET 6 Support#403

Closed
jayharris wants to merge 5 commits intoivaylokenov:version-5.0from
jayharris:dotnet-6
Closed

Add .NET 6 Support#403
jayharris wants to merge 5 commits intoivaylokenov:version-5.0from
jayharris:dotnet-6

Conversation

@jayharris
Copy link
Copy Markdown

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.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jan 29, 2022

CLA assistant check
All committers have signed the CLA.

@jayharris
Copy link
Copy Markdown
Author

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.

@botrot
Copy link
Copy Markdown

botrot commented Jun 16, 2022

Is this PR going to be merged soon, what is the plan?

@clmcgrath
Copy link
Copy Markdown

i think this project is dead TBH
the OC stated in an issue that he is barely touching this now

@kalintsenkov
Copy link
Copy Markdown
Collaborator

Resolved #405

@jayharris jayharris deleted the dotnet-6 branch February 22, 2026 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants