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

App.Metrics.AppNetCore has a dependency on ASP.NET as of 4.2.0 #745

Open
webley opened this issue Oct 20, 2022 · 1 comment
Open

App.Metrics.AppNetCore has a dependency on ASP.NET as of 4.2.0 #745

webley opened this issue Oct 20, 2022 · 1 comment

Comments

@webley
Copy link

webley commented Oct 20, 2022

PR 630 added a Microsoft.AspNetCore.App framework dependency to both App.Metrics.AppNetCore and App.Metrics.Extensions.Hosting.

As a result, it's no longer possible to host AppMetrics endpoints without AspNetCore also being installed. This is evident when trying to host endpoints in a console application (using a raw HttpListener or lightweight web server) inside a docker container based on mcr.microsoft.com/dotnet/runtime:6.0.

When running against AppMetrics 4.2.0 or later a framework error cause the application to crash:

You must install or update .NET to run this application.

App: /app/bin/Debug/net6.0/AppName.dll
Architecture: x64
Framework: 'Microsoft.AspNetCore.App', version '6.0.0' (x64)
.NET location: /usr/share/dotnet/

No frameworks were found.

Downgrading AppMetrics to 4.1.0 allows this to work as expected.

Is there anything about 4.2.0 that means these packages are actually now tied to ASP.NET or is the framework reference an oversight that should be removed?

@JoelDavidLang
Copy link

JoelDavidLang commented Nov 3, 2022

I certainly don't want to bring in an ASP.NET Core dependency when using the new .NET Hosting framework. Can this change be reverted?

It also looks like Microsoft.Extensions.Hosting.Abstractions is not one of those libraries that was merged into the app framework, so the NuGet package can still be used fine outside of it when targeting netcoreapp3.1.

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

No branches or pull requests

2 participants