I am trying to enable Code-based monitoring with application insights to my existing ASP.Net desktop application, I have performed the below steps :
Selected Project > Add Application Insights Telemetry > Application Insights Sdk (local) > Next > Finish > Close. (Installed Application Insights NuGet packages)
Opened the ApplicationInsights.config file. and added the InstrumentationKey Before the closing in the config file
Selected Project > Manage NuGet Packages > Updates. Then updated each Microsoft.ApplicationInsights NuGet package to the latest stable release.
Also, Installed Microsoft.ApplicationInsights.NLogTarget NuGet package.
When I am running the application locally in debug mode it's sending all the relevant data and exceptions logs to the Application Insight portal. But when I deploy the same, it does not send any data or exception logs to Application Insight portal.
What could possibly cause this issue and how this can be fixed?
Note: On the same deployment server where above code based implementation is not working, I Installed application insight agent and enabled monitoring using powershell scripts. And that works fine and send data to application insight portal.
Can anyone guide me how can I get the first approach(code-based) working after deployment ?
Thanks in advance !
I hope you are already updated the related Application Insights packages. Check the below possibilities to fix no data shared to Application Insights