-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Application Insights profiler (AddServiceProfiler) fails when using Lamar #352
Comments
@andreas-valtech The real issue here being that the optional constructor argument should be ignored? I'll get around to this at some point, but I'd point at foolish design on their part for DI usage. |
Big thanks for the workaround @andreas-valtech :-) I made a bug report before finding this issue. microsoft/ApplicationInsights-Profiler-AspNetCore#181 We will see if they are willing to make a change for the problem. |
I get this when profiler trying to upload to Azure. Guess it is not made for other IoC frameworks at all...
|
This is now resolved by Microsoft in the above mentioned issue (microsoft/ApplicationInsights-Profiler-AspNetCore#181). I have verified it myself and everything works as expected (without any workarounds in place) in the 2.5.2 release of Microsoft.ApplicationInsights.Profiler.AspNetCore. This issue can be closed. |
In the method
AddServiceProfiler
from the packageMicrosoft.ApplicationInsights.Profiler.AspNetCore
a dependecy on aFunc<int>
is used which crashes Lamar if no such registration is found. The built in IoC container just ignores the parameter since it has a default value.The failure happens in
ProcessInfoCPUMetricsProvider
since it cant resolve theFunc<int> getProcessorCount
dependency:I have added a workaround in my Startup.cs which works but is a bit sketchy:
Using Lamar.Microsoft.DependencyInjection version 8.0.1.
The stack trace I get without the workaround above is:
The text was updated successfully, but these errors were encountered: