Dnn.Platform
Dnn.Platform copied to clipboard
Bump Microsoft.Extensions.DependencyInjection from 2.1.1 to 6.0.0
Bumps Microsoft.Extensions.DependencyInjection from 2.1.1 to 6.0.0.
Release notes
Sourced from Microsoft.Extensions.DependencyInjection's releases.
.NET 6.0
.NET 6.0 RC 2
.NET 6.0 RC 1
.NET 6.0 Preview 7
.NET 6.0 Preview 6
.NET 6.0 Preview 5
.NET 6.0 Preview 4
.NET 6.0 Preview 3
.NET 6.0 Preview 2
.NET 6.0 Preview 1
.NET 5.0.14
.NET 5.0.13
.NET 5.0.11
.NET 5.0.9
.NET 5.0.8
.NET 5.0.7
.NET 5.0.6
... (truncated)
Commits
- See full diff in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
-
@dependabot rebase
will rebase this PR -
@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it -
@dependabot merge
will merge this PR after your CI passes on it -
@dependabot squash and merge
will squash and merge this PR after your CI passes on it -
@dependabot cancel merge
will cancel a previously requested merge and block automerging -
@dependabot reopen
will reopen this PR if it is closed -
@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually -
@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
@bdukes we can't do this right because we are on .NetFramework.
If that is correct, can we try and list those dependencies we don't want dependabot to warn us about, I can declare those in the dependabot config file so we have less of those PRs we can't merge for a long while...
This package still supports .NET 4.6.1 and .NET Standard 2.0, so we should be able to reference it
Ok, cool, thanks for the info.
We have detected this issue has not had any activity during the last 90 days. That could mean this issue is no longer relevant and/or nobody has found the necessary time to address the issue. We are trying to keep the list of open issues limited to those issues that are relevant to the majority and to close the ones that have become 'stale' (inactive). If no further activity is detected within the next 14 days, the issue will be closed automatically. If new comments are are posted and/or a solution (pull request) is submitted for review that references this issue, the issue will not be closed. Closed issues can be reopened at any time in the future. Please remember those participating in this open source project are volunteers trying to help others and creating a better DNN Platform for all. Thank you for your continued involvement and contributions!
A newer version of Microsoft.Extensions.DependencyInjection exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged.
Note, in the new version of Microsoft.Extensions.DependencyInjection, IServiceScope
implements IAsyncDisposable.
If there is a service registered which only implements IAsyncDisposable
(and not IDisposable
), the scope and service provider must call DisposeAsync
, otherwise an exception is being thrown
If we want to prevent this, we'll have to modify the following:
https://github.com/dnnsoftware/Dnn.Platform/blob/421210f9a20d1c272db77e7208f7a5e960011534/DNN%20Platform/HttpModules/DependencyInjection/ServiceRequestScopeModule.cs#L64-L69
To something like this:
/// <inheritdoc/>
public void Init(HttpApplication context)
{
context.BeginRequest += this.Context_BeginRequest;
- context.EndRequest += this.Context_EndRequest;
+
+ var wrapper = new EventHandlerTaskAsyncHelper(this.Context_EndRequest);
+ context.AddOnEndRequestAsync(wrapper.BeginEventHandler, wrapper.EndEventHandler);
}
- private void Context_EndRequest(object sender, EventArgs e)
+ private async Task Context_EndRequest(object sender, EventArgs e)
{
var context = ((HttpApplication)sender).Context;
- context.GetScope()?.Dispose();
+
+ switch (context.GetScope())
+ {
+ case IAsyncDisposable asyncDisposable:
+ await asyncDisposable.DisposeAsync();
+ break;
+ case IDisposable disposable:
+ disposable.Dispose();
+ break;
+ }
+
context.ClearScope();
}
I don't know if the root service provider (created in Application_Start) gets disposed, otherwise we have to change this as well.
Superseded by #5670
OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version
or @dependabot ignore this minor version
. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore
condition with the desired update_types
to your config file.
If you change your mind, just re-open this PR and I'll resolve any conflicts on it.