-
Notifications
You must be signed in to change notification settings - Fork 119
Missing Type in ServiceCollection when upgrading Microsoft.ApplicationInsights.AspNetCore 2.1.0 to 2.1.1 #502
Comments
Yeah, it looks like something introduced recently to address potential security vulnerability. This class only registered by MVC. Something like this: https://github.com/aspnet/HtmlAbstractions/blob/c2690023d8f14f8deb64b9571212ad2da5ff6541/src/Microsoft.Extensions.WebEncoders/EncoderServiceCollectionExtensions.cs#L37 Try to register it as a workaround. In the next version we will need to have an override that do not depend on this class. |
thx sergey |
@SergeyKanzhelev Or should AI SDK try to add JavaScriptEncoder, if not already added? |
Or check if JavaScriptEncoder is already injected, if not dont add AI JavascriptSnippet..? something like this.. |
@cijothomas the point of this bug is make it not to throw. Implementation of this encoder is like 20 lines of code or so... So we can fall back to custom encoder |
This bug exists, but not introduced in 2.2.0-betas. While this needs fixed, it should not block 2.2.0 stable release. |
I also encounter this error in my Integration Tests. The only solution I found is to completly remove Application Insight from my Webapp on the client side. I would wather keep using it since its very helpfull to our team. |
I just came accross this here: aspnet/Mvc#8340 (comment) when using asp.net core 2.0 The only solution I found was either to call My case is non standard, but even so this was problematic. ApplicationInsights seems to be a very special cased library and its hard to diagnose what is going wrong when there is a failure. |
Only thing that got it working for me is injecting the following services manually while testing:
The CustomAuth had to be removed also for this to work. |
This is an issue with default webapi apps in asp.net core 3.0 preview builds. Tagging to fix for the next immediate release. |
Moved from https://github.com/Microsoft/ApplicationInsights-Home/issues/139
I have a unittest that tries to create all services in my service collection.
While populating the service collection I call
services.AddApplicationInsightsTelemetry( configuration );
in 2.1.0 i could create all services application insights adds
in 2.1.1 i get
am i supposed to call another add stuff method or should this type be registered in
AddApplicationInsightsTelemetry
The text was updated successfully, but these errors were encountered: