Application Insights tracing not working for asp.net project

meenakshi sekar 6 Reputation points
2021-01-12T08:38:25.72+00:00

App Insights is not working in one of project. It works in the MVC project of that solution but it doesn't work in the older aspx project. could you please help me. I updated the sdk to use 2.16 which works in the MVC but the same is not working in the older aspx project.

Not sure if it is because it has nlog.config file in the older aspx project. I just tried to move the below config from the web.config file to the nlog.config file
<!--<nlog>
<extensions>
<add assembly="Microsoft.ApplicationInsights.NLogTarget"/>
</extensions>
<targets>
<target type="ApplicationInsightsTarget" name="aiTarget"/>
</targets>
<rules>
<logger name="*" minlevel="Trace" writeTo="aiTarget"/>
</rules>
</nlog>-->

While doing so, I was not able to specify the target for the Application insights. Please find the error below. I tried changing the type to xsi:type but even that didn't help me. got a different error. Is this the reason why the tracing didn't work in the portal of Azure? Please help me to fix it.
image

image

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,867 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,317 questions
{count} vote