Is there any way to see Application Insights events (like SQL queries) in a Console application just like in a ASP.NET application?

I have installed Application Insights NuGets, configured the ApplicationInsights.config and I can see the events in the Output window but I cannot see them in the Diagnostic Tools window.

Thanks in advance.

1

There are 1 answers

1
John Gardner On

I'm not positive this will work, but

if you have an asp.net application that is configured to work, if you open up the .csproj file an look in it, somewhere near the top in a PropertyGroup section it should have something like

<ApplicationInsightsResourceId>/subscriptions/[some guid]/resourceGroups/[some name]/providers/microsoft.insights/components/[resource name]</ApplicationInsightsResourceId>

paste that into a property group in the console app's .csproj, and reload the solution.

I think when you start debugging that's one of the things we look for, though we might have simplified some of this in VS2017 that used to work that way in VS2015.

in Vs2017 we might only be looking for project types we know we support in the diagnostic hub?

let me know if that doesn't work and I can go see if there's anything else that can force it to turn on.