You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
.NET March 2022 Update - .NET 6.0.3, .NET 5.0.15, and .NET Core 3.1.23 #7259
Note: This list refers to the Microsoft-provisioned feeds (packages.microsoft.com) and does not in any way represent direct availability in distros (eg RHEL, Fedora).
Known Issues
If there are any more issues with this release we will track them here and check issues off as they're resolved. See the linked issues for details on progress and resolution details.
Hi team, after upgrading to 6.0.3(vs2022 17.1.1), I got an error Cannot access a disposed object. Object name: 'ConfigurationManager'. in var app = builder.Build();. May I know what change I should do to fix this issue? Thanks. I tried to downgrade to 6.0.2 by reinstalling vs2022 17.1.0 and it worked fine.
at Microsoft.Extensions.Configuration.ReferenceCountedProviderManager.AddProvider(IConfigurationProvider provider)
at Microsoft.Extensions.Configuration.ConfigurationManager.AddSource(IConfigurationSource source)
at Microsoft.Extensions.Configuration.ConfigurationManager.Microsoft.Extensions.Configuration.IConfigurationBuilder.Add(IConfigurationSource source)
at Microsoft.AspNetCore.Builder.WebApplicationBuilder.<>c__DisplayClass25_0.b__2(HostBuilderContext context, IServiceCollection services)
at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
at Microsoft.Extensions.Hosting.HostBuilder.Build()
at Microsoft.AspNetCore.Builder.WebApplicationBuilder.Build()
manualy removed the 6.0.201 sdk, and the 6.0.3 Aspnetcore.App & NetcoreApp from our build server
set the dotnet version fixed to DotNetVersion: "6.0.103" in our yaml file instead of 6.0.x
and our build is working again
There is a change coming in 6.0.4 that fixes at least one case of this issue. If other folks like @frankyuan and @bc3 could provide minimal repro apps so we can make sure we cover everything that would be helpful.
@Pilchie after looking at the exception that's being thrown when adding Convey, it appears that ReferenceCountedProviderManager class was introduced in dotnet/runtime#63816 to fix the configurations locking issue. I suspect this might happen in other scenarios where configurations need to be synchronized. @bc3 can you provide a minimum repro with WebApplicationFactory ? - Assigning the following issue dotnet/aspnetcore#40614 to @halter73 for further investigation.
Activity
frankyuan commentedon Mar 9, 2022
Hi team, after upgrading to 6.0.3(vs2022 17.1.1), I got an error
Cannot access a disposed object. Object name: 'ConfigurationManager'.invar app = builder.Build();. May I know what change I should do to fix this issue? Thanks. I tried to downgrade to 6.0.2 by reinstalling vs2022 17.1.0 and it worked fine.at Microsoft.Extensions.Configuration.ReferenceCountedProviderManager.AddProvider(IConfigurationProvider provider)
at Microsoft.Extensions.Configuration.ConfigurationManager.AddSource(IConfigurationSource source)
at Microsoft.Extensions.Configuration.ConfigurationManager.Microsoft.Extensions.Configuration.IConfigurationBuilder.Add(IConfigurationSource source)
at Microsoft.AspNetCore.Builder.WebApplicationBuilder.<>c__DisplayClass25_0.b__2(HostBuilderContext context, IServiceCollection services)
at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
at Microsoft.Extensions.Hosting.HostBuilder.Build()
at Microsoft.AspNetCore.Builder.WebApplicationBuilder.Build()
philip-reed commentedon Mar 9, 2022
Also having the same issue as @frankyuan
Not sure where the most appropriate place to log the issue is.
philip-reed commentedon Mar 9, 2022
@frankyuan I don't suppose you are using Convey?
My initial investigations are marking that as prime suspect in my app.
philip-reed commentedon Mar 9, 2022
Repro solution here:
https://github.com/philip-reed/40614
bc3 commentedon Mar 9, 2022
Also having the same issue since 8/3/2022 on our build servers:
OneTimeSetUp: System.ObjectDisposedException : Cannot access a disposed object.
Object name: 'ConfigurationManager'.
It is an integrationtest that is bootstrapping our api using the WebApplicationFactory class
We do not use Convey or Scrutor like in dotnet/aspnetcore#40614
Work-around:
manualy removed the 6.0.201 sdk, and the 6.0.3 Aspnetcore.App & NetcoreApp from our build server
set the dotnet version fixed to DotNetVersion: "6.0.103" in our yaml file instead of 6.0.x
and our build is working again
leecow commentedon Mar 9, 2022
@Pilchie @dougbu , can you take a look at the above reports?
ah, Looks like Brennan has the repro worked out at dotnet/aspnetcore#40614 (comment)
dougbu commentedon Mar 10, 2022
Highlighting @BrennanConroy's workaround:
BrennanConroy commentedon Mar 10, 2022
That workaround is very specific to the Convey usage, not everyone who is hitting this issue is using Convey.
frankyuan commentedon Mar 10, 2022
Agree, we don't use Convey but still run into this issue.
Pilchie commentedon Mar 10, 2022
@rafikiassumani-msft can you take a look here?
Pilchie commentedon Mar 10, 2022
@rafikiassumani-msft - possibly related to dotnet/runtime#63816?
BrennanConroy commentedon Mar 10, 2022
There is a change coming in 6.0.4 that fixes at least one case of this issue. If other folks like @frankyuan and @bc3 could provide minimal repro apps so we can make sure we cover everything that would be helpful.
Let's continue the discussion at dotnet/aspnetcore#40614
rafikiassumani-msft commentedon Mar 10, 2022
@Pilchie after looking at the exception that's being thrown when adding Convey, it appears that
ReferenceCountedProviderManagerclass was introduced in dotnet/runtime#63816 to fix the configurations locking issue. I suspect this might happen in other scenarios where configurations need to be synchronized. @bc3 can you provide a minimum repro withWebApplicationFactory? - Assigning the following issue dotnet/aspnetcore#40614 to @halter73 for further investigation.philip-reed commentedon Mar 10, 2022
Yes, this seems to work around the issue in my repro app.
bc3 commentedon Mar 11, 2022
@rafikiassumani-msft , i finally got around to reproduce the bug. I got a solution with integration test ready for you to test the issue
for us the issue was throw eventually by this code:
services.AddApplicationInsightsKubernetesEnricher();it is an extension method from package:
Microsoft.ApplicationInsights.Kubernetesfrom repo https://github.com/microsoft/ApplicationInsights-KubernetesIssueDotnetCore603.zip
BrennanConroy commentedon Mar 11, 2022
Looks like the Kubernetes issue was fixed back in August microsoft/ApplicationInsights-Kubernetes#237. Update your app to version 2.0.2 to fix it.
And it's the same root cause as all the other repros on this thread. Building the service provider early and then disposing it.
rafikiassumani-msft commentedon Mar 11, 2022
I will lock conversations on this announcement. Let's continue the discussion at dotnet/aspnetcore#40614.
dcwhittaker commentedon Apr 12, 2022
Closed in favor of #7362