无法添加Application Insights-无法安装软件包"Microsoft.Web.Infrastructure" [英] Cannot add Application Insights - Failed to install package 'Microsoft.Web.Infrastructure'

查看:821
本文介绍了无法添加Application Insights-无法安装软件包"Microsoft.Web.Infrastructure"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试监视CloudService的内存使用情况,偶然发现了Application Insights.

当我尝试添加它时,出现以下错误消息:

  1. 右键单击WebProject->添加Application Insights Telemetrik
  2. 插入订阅数据->单击添加"按钮
  3. 现在,当VS尝试安装"Microsoft.ApplicationInsights.Web.2.0.0"时,就会发生错误.

我们正在使用VS2015和Windows 10

修改:
有趣的是,我可以通过nuget-console安装Microsoft.ApplicationInsights.Web 2.0.0版.但是当我之后尝试再次添加ApplicationInsights时,它会引发相同的错误,并且包管理器控制台显示:

\ Path \ To \ Project \ packages \ Microsoft.Bcl.1.0.14中的软件包无法卸载.重新启动Visual Studio以完成该过程.

解决方案

可以尝试的方法:

  1. 关闭VS,并以管理员身份启动一次.您可能拥有旧的自动更新的扩展程序等,直到您以管理员身份运行后才需要清理.然后关闭该管理员VS,然后返回正常的非管理员VS.

  2. 清除解决方案中的nuget软件包,然后进行完全重建,以确保项目中所有当前的软件包都已正确且完整地安装.当我们尝试以编程方式安装AI nuget软件包时,Nuget尝试验证所有现有软件包,有时在验证已安装的东西时出了问题

  3. 然后尝试通过该工具重新添加AI.

如果仍然出现错误,请查看错误消息中显示的目录,并进行注释,并让我知道(a)该文件夹是否存在,(b)该文件夹是否存在,其中有什么?

如果仍然失败,则应该能够从nuget软件包管理器中手动添加Microsoft.ApplicationInsights.Web nuget软件包,然后完成此操作,右键单击nuget添加的"ApplicationInsights.config"文件软件包安装,您应该会看到配置应用程序见解"选项,该选项可让您选择帐户,订阅和AI资源,并会在配置文件中为您更新.如果这些都不起作用,您可以给我发邮件到jgardner @ microsoft,我可以尝试为您查找更多详细信息.

编辑以添加:如果您遇到有关Microsoft.Bcl的错误,则您的项目可能是针对.NET 4.0的,这可能就是我们今天刚刚发现的问题.假设地,如果您首先手动将microsoft.bcl安装到项目中,那么该特定软件包 的特定错误应该消失吗? (我们正在努力验证此特定依赖性并尽快修复此问题).

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:

  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.

解决方案

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).

这篇关于无法添加Application Insights-无法安装软件包"Microsoft.Web.Infrastructure"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆