We need to remove System.Diagnostics.DiagnosticSource in order to ApplicationInsights work properly (as per Microsoft) but Umbraco have this dependency.
We are using Umbraco version 8.12.2 and we have Web API project that reference UmbracoCms.Core version 8.12.2 to get CMS data using Web Api controllers. This library references MiniProfiler and MiniProfiler is referencing System.Diagnostics.DiagnosticSource.
"If any of these entries exist, remove the following packages from your application: Microsoft.ApplicationInsights, System.Diagnostics.DiagnosticSource, and Microsoft.AspNet.TelemetryCorrelation."
So, we need to remove System.Diagnostics.DiagnosticSource in order to ApplicationInsights work properly but we can't. What can we do in this case?
We are looking for Agent based solution as adding Microsoft.ApplicationInsights.Web break the application with assembly versions (assembly redirect issues)
Belive me it breaks mine with system.diagnostics.diagnosticsource assembly and I needed to add assembly redirect. That's why we prefer to use agent based solution.
ApplicationInsights, MiniProfiler in Umbraco API
We need to remove System.Diagnostics.DiagnosticSource in order to ApplicationInsights work properly (as per Microsoft) but Umbraco have this dependency.
We are using Umbraco version 8.12.2 and we have Web API project that reference UmbracoCms.Core version 8.12.2 to get CMS data using Web Api controllers. This library references MiniProfiler and MiniProfiler is referencing System.Diagnostics.DiagnosticSource.
As per Microsoft documentation https://docs.microsoft.com/en-us/azure/azure-monitor/app/azure-web-apps-net,
"If any of these entries exist, remove the following packages from your application: Microsoft.ApplicationInsights, System.Diagnostics.DiagnosticSource, and Microsoft.AspNet.TelemetryCorrelation."
So, we need to remove System.Diagnostics.DiagnosticSource in order to ApplicationInsights work properly but we can't. What can we do in this case?
Add
Microsoft.ApplicationInsights.Web
NuGet to your solution instead of using the agent-based option and add your instrumentation key or connection string. https://our.umbraco.com/Documentation/Umbraco-Cloud/Set-Up/Application-Insights/index-v7We are looking for Agent based solution as adding
Microsoft.ApplicationInsights.Web
break the application with assembly versions (assembly redirect issues)No, it won't, I have many website running it
Belive me it breaks mine with system.diagnostics.diagnosticsource assembly and I needed to add assembly redirect. That's why we prefer to use agent based solution.
Yup, you need those redirects, as you point out this is why you cannot use the agent option with Umbraco8
Should we assume this is as likely official umbraco response to support AppInsights and agent based solution will not work?
See https://github.com/Azure/azure-sdk-for-net/issues/17936#issuecomment-760406470
Using the NuGet packages is the resolution for .Net Framework.
is working on a reply...