-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Diagnostic extension causes crash of ASP.NET Core applications #47
Comments
Yes, Diagnostic extension does not work with ASP.NET Core. It follows original Unity spec and is too strict for .NET implementation. Microsoft uses much more relaxed validation. This library needs its own validation implementation. |
I also came across this issue and I think this should be fixed in this package if it's a dependency of the Unity.Diagnostic extension. I'm not sure of which spec you are talking about but we just need to tell the UnityContainer how to resolve this ambiguous dependency because there is two constructors with the same number of arguments. I also came across similar issues with ISwaggerProvider and ISchemaRegistryFactory for Swashbuckle but this did the trick to resolve the ILoggerFactory dependency:
|
I would be happy to accept a pull request with the fix |
OK I am swamped this week but I should be able to send the pull request next week. |
Any update on this? |
Any movement on this? I'm running into this as well. |
Also still facing this. Build-up problems are a total pain to debug without the the diagnostics extension enabled; but enabling the diagnostics extension completely hoses the entire application. This really, really, REALLY needs a fix as a top priority. It basically makes Unity a total liability when used for a large scale ASP.NET application, which is probably the single most major type of application being developed with .NET Core. There's more issues with the diagnostics extension than just the logger disambiguation; I've also had it crap out with a seg-fault in the past. |
Can you create a small test app with all of these? |
@ENikS I'm not exactly at liberty to share the full source code for the projects in which my teams ran across these issues either. 😞 |
@rjgotten Makes it harder to help you, don't you think? |
I got same exception on ASP NET Core 7 |
It would help if you explained how it happened
|
Took the code from original post, added an empty Startup like below, added class Startup
{
public void ConfigureServices(IServiceCollection services)
{
}
public void Configure(WebApplication app, IWebHostEnvironment env)
{
}
} |
It seems NET7 is not compatible with 5.x |
How to reproduce
Use standard ASP.NET Core application (I'm tried on
netcoreapp2.1
,netcoreapp2.2
andnetcoreapp3.0
)The following exception throws:
The real under hood exception from
Unity.Microsoft.DependencyInjection.ServiceProvider
isIf remove
Diagnostic
extension from the container then everything works fine.The text was updated successfully, but these errors were encountered: