8
votes

I try to monitor the memory usage of my CloudService and stumbled upon Application Insights.

When I try to add it I get following error message:

Errormessage

  1. right click on WebProject -> Add Application Insights Telemetrik
  2. Insert Subscription-Data -> click Add-Button
  3. Now the error occurs when VS tries to install 'Microsoft.ApplicationInsights.Web.2.0.0'

We are using VS2015 and Windows 10

Edit:
The fun thing is I can install Microsoft.ApplicationInsights.Webversion 2.0.0 via the nuget-console. But when I afterwards try to add the ApplicationInsights again it throws the same error and the package-manager-console displays:

The package at \Path\To\Project\packages\Microsoft.Bcl.1.0.14 failed to uninstall. Restart Visual Studio to finish the process.

2
What's the error in the Output window? Open the Output window after you tried to add the package and in the 'Show output from:' choose 'Package Manager'.yonisha
I don't have the option 'Package Manager'.JDurstberger
Once you install Microsoft.ApplicationInsights.Web via nuget console it should be already available to you, no additional installation required. You should see ApplicationInsights.config file and you should be able to reference TelemetryClient. Doesn't it work?yonisha
I get the configs and everything but I do not know how to configure it for my azure account. I also do not see the option to run the application insights shown here: azure.microsoft.com/en-us/documentation/articles/…JDurstberger
Naïve question but worth asking: did you enable the toolbar? go to 'View --> Toolbars --> Application Insights'.yonisha

2 Answers

6
votes

Things you can try:

  1. close VS, and start it once as admin. You may have old auto-updated extensions, etc that haven't been cleaned up until you run as admin. then close that admin VS and go back to your normal non-admin VS.

  2. clear out your nuget packages in your solution, and then doing a full re-build to ensure that all of the current packages in your project are correctly and fully installed. when we try to install the AI nuget packages programmatically, Nuget tries to validate all of the existing packages and sometimes something goes wrong there validating things that already installed

  3. then try re-adding AI through the tool.

if you still get the error, look in the directory shown in the error message, and comment and let me know if (a) that folder exists at all and (b) if it does exist, what's in it?

If things are still failing, you should be able to add the Microsoft.ApplicationInsights.Web nuget package manually from nuget package manager, and after that is done, right click the "ApplicationInsights.config" file that was added by the nuget package install, and you should see a "configure application insights" option that will let you pick your account, subscription, and AI resource, and that will get updated in the config file for you. If none of that works, you can send me a mail to jgardner @ microsoft and i can try to track down more details for you.

Edit to add: If you get this error about Microsoft.Bcl, then your project is probably targeting .NET 4.0 and this is probably an issue we just found today. hypothetically, if you manually install microsoft.bcl into the project first, then that specific error for that specific package should go away? (we're working on verifying this specific dependency and fixing this asap).

0
votes

A simple Visual Studio restart fixed the issue for me.