Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NET6 and IServiceProviderIsService support. #91

Merged
merged 19 commits into from
Jul 15, 2021
Merged

NET6 and IServiceProviderIsService support. #91

merged 19 commits into from
Jul 15, 2021

Conversation

alistairjevans
Copy link
Member

Raising a PR to bring this in now the builds are passing, and .NET 6 Preview 6 has been released with IServiceProviderIsService available.

I've made AutofacServiceProvider a partial class, and put the .NET 6 specific service on a partial in it's own file. Seemed like the cleanest way to add it.

All the new specific tests added by the dotnet team that validate this new behaviour are passing.

@codecov
Copy link

codecov bot commented Jul 15, 2021

Codecov Report

Merging #91 (b37b774) into develop (316da00) will increase coverage by 3.35%.
The diff coverage is 96.55%.

❗ Current head b37b774 differs from pull request most recent head bb66b26. Consider uploading reports for the commit bb66b26 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #91      +/-   ##
===========================================
+ Coverage    92.74%   96.09%   +3.35%     
===========================================
  Files            9       10       +1     
  Lines          124      128       +4     
  Branches        23       23              
===========================================
+ Hits           115      123       +8     
+ Misses           5        1       -4     
  Partials         4        4              
Impacted Files Coverage Δ
...n/AutofacChildLifetimeScopeConfigurationAdapter.cs 100.00% <ø> (ø)
...DependencyInjection/ServiceCollectionExtensions.cs 100.00% <ø> (ø)
...s.DependencyInjection/ServiceProviderExtensions.cs 66.66% <0.00%> (ø)
...AutofacChildLifetimeScopeServiceProviderFactory.cs 91.30% <100.00%> (ø)
...ensions.DependencyInjection/AutofacRegistration.cs 95.55% <100.00%> (+0.31%) ⬆️
...ions.DependencyInjection/AutofacServiceProvider.cs 100.00% <100.00%> (ø)
...DependencyInjection/AutofacServiceProvider.net6.cs 100.00% <100.00%> (ø)
...ensions.DependencyInjection/AutofacServiceScope.cs 100.00% <100.00%> (+25.00%) ⬆️
....DependencyInjection/AutofacServiceScopeFactory.cs 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 316da00...bb66b26. Read the comment docs.

@tillig
Copy link
Member

tillig commented Jul 15, 2021

I figured out the problem with VS Code - OmniSharp only looks at the first item in TargetFrameworks and generates issues and Intellisense based on that. I've moved the .NET 6 framework (and conditional references) to be encountered first in the projects and it's resolved all the weird "error being displayed but it compiles just fine" problems.

Copy link
Member

@tillig tillig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍇

@tillig tillig merged commit 553f288 into develop Jul 15, 2021
@tillig tillig deleted the feature/net6 branch July 15, 2021 14:30
@tillig
Copy link
Member

tillig commented Jul 15, 2021

Since this seems to be high visibility would it be worth putting a beta out on NuGet for folks to try?

@alistairjevans
Copy link
Member Author

Seems like a good idea.

Assuming you mean pushing 7.2.0-develop-00520 from MyGet to NuGet as 7.2.0-preview.1 or something?

@tillig
Copy link
Member

tillig commented Jul 15, 2021

Exactly that. I can take care of it later if you don't have time, either way.

@alistairjevans
Copy link
Member Author

I'll push it later, should only take a minute. I'll raise a GitHub preview release for it as well.

@alistairjevans
Copy link
Member Author

Nuget package pushed, I'll post on that original runtime thread that it's available.

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.

2 participants