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

.NET March 2022 Update - .NET 6.0.3, .NET 5.0.15, and .NET Core 3.1.23 #7259

Closed
dcwhittaker opened this issue Mar 8, 2022 · 18 comments
Closed

Comments

@dcwhittaker
Copy link
Member

dcwhittaker commented Mar 8, 2022

Release Notes
6.0.3
5.0.15
3.1.23

Please report any issues you find either by responding to this issue, creating a new issue or creating a new issue in one of the following repos:

Distro 6.0.3 5.0.15 3.1.23
Ubuntu 18.04
Ubuntu 20.04
Ubuntu 21.04
Centos 7
Debian 10
Debian 11
Fedora 33
Fedora 34
OpenSUSE 15
Oracle

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.

@frankyuan
Copy link

frankyuan commented 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'. 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()

@philip-reed
Copy link

Also having the same issue as @frankyuan
Not sure where the most appropriate place to log the issue is.

@philip-reed
Copy link

@frankyuan I don't suppose you are using Convey?
My initial investigations are marking that as prime suspect in my app.

@philip-reed
Copy link

Repro solution here:

https://github.com/philip-reed/40614

image

@bc3
Copy link

bc3 commented 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
Copy link
Member

leecow commented 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
Copy link
Member

dougbu commented Mar 10, 2022

Highlighting @BrennanConroy's workaround:

You can likely workaround the issue by passing builder.Configuration to AddConvey()

builder.Services.AddConvey(configuration: builder.Configuration);

@BrennanConroy
Copy link
Member

That workaround is very specific to the Convey usage, not everyone who is hitting this issue is using Convey.

@frankyuan
Copy link

frankyuan commented Mar 10, 2022

That workaround is very specific to the Convey usage, not everyone who is hitting this issue is using Convey.

Agree, we don't use Convey but still run into this issue.

@Pilchie
Copy link
Member

Pilchie commented Mar 10, 2022

@rafikiassumani-msft can you take a look here?

@Pilchie
Copy link
Member

Pilchie commented Mar 10, 2022

@rafikiassumani-msft - possibly related to dotnet/runtime#63816?

@BrennanConroy
Copy link
Member

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
Copy link

rafikiassumani-msft commented Mar 10, 2022

@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.

@philip-reed
Copy link

Highlighting @BrennanConroy's workaround:

You can likely workaround the issue by passing builder.Configuration to AddConvey()

builder.Services.AddConvey(configuration: builder.Configuration);

Yes, this seems to work around the issue in my repro app.

@bc3
Copy link

bc3 commented 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.Kubernetes from repo https://github.com/microsoft/ApplicationInsights-Kubernetes

IssueDotnetCore603.zip

@BrennanConroy
Copy link
Member

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
Copy link

rafikiassumani-msft commented Mar 11, 2022

I will lock conversations on this announcement. Let's continue the discussion at dotnet/aspnetcore#40614.

@dotnet dotnet locked and limited conversation to collaborators Mar 11, 2022
@dcwhittaker
Copy link
Member Author

Closed in favor of #7362

@dcwhittaker dcwhittaker unpinned this issue Apr 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants