Vac*_*ano 6 visual-studio azure-application-insights visual-studio-2017
我尝试使用 Visual Studio 向导将 Application Insights 添加到我的应用程序。当我在办公室计算机上执行此操作时,效果很好。但是当我尝试在家中执行此操作时,它失败并出现以下错误消息:
---------------------------- 微软视觉工作室 ---------------------------- 无法将 Application Insights 添加到项目。 安装包失败: Microsoft.ApplicationInsights.Web 有错误: 无法解决依赖关系。“Microsoft.ApplicationInsights 2.5.0”不兼容 'Microsoft.ApplicationInsights.DependencyCollector 2.4.1 约束:Microsoft.ApplicationInsights (= 2.4.0)', 'Microsoft.ApplicationInsights.PerfCounterCollector 2.4.1 约束:Microsoft.ApplicationInsights (= 2.4.0)', 'Microsoft.ApplicationInsights.Web 2.4.1 约束:Microsoft.ApplicationInsights (= 2.4.0)', 'Microsoft.ApplicationInsights.WindowsServer 2.4.1 约束:Microsoft.ApplicationInsights (= 2.4.0)', “Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel 2.4.0 约束:Microsoft.ApplicationInsights (= 2.4.0)”。
看来我在某些部分安装了2.5.0,在其他部分安装了2.4。但我不知道什么会导致这个......我只是运行向导。除了 Visual Studio(与 App Insights 相关)之外,我没有安装任何东西。
我后来尝试安装 Application Insights Status Monitor,但这并没有影响该错误。
任何有关如何处理此错误的想法将不胜感激......
细节:
每当安装或重新安装包(包括作为还原过程的一部分进行安装)时,NuGet 还会安装第一个包所依赖的任何其他包。
这些直接依赖关系可能也有它们自己的依赖关系,这些依赖关系可以持续到任意深度。这会产生所谓的依赖图,描述各个级别的包之间的关系。
在包恢复操作期间,您可能会看到错误“一个或多个包不兼容...”或者包与项目的目标框架“不兼容”。
当项目中引用的一个或多个包不表明它们支持项目的目标框架时,就会出现此错误;也就是说,该包在其
lib文件夹中不包含与该项目兼容的目标框架的合适 DLL。
所以,我认为这是因为包的依赖性问题。
根据nuget.org、Microsoft.ApplicationInsights.DependencyCollector 2.4.1、Microsoft.ApplicationInsights.PerfCounterCollector 2.4.1、Microsoft.ApplicationInsights.Web 2.4.1和require 完全 ie = 不 >=Microsoft.ApplicationInsights.WindowsServer 2.4.1但你有Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel 2.4.0Microsoft.ApplicationInsights 2.4.0Microsoft.ApplicationInsights 2.5.0
所以你需要将其降级Microsoft.ApplicationInsights 2.5.0到Microsoft.ApplicationInsights 2.4.0.
要降级,Microsoft.ApplicationInsights 2.5.0您可以卸载软件包并安装所需版本的软件包。您可以按照以下命令操作。
Uninstall-Package Microsoft.ApplicationInsights -Force
Install-Package Microsoft.ApplicationInsights -Version 2.4.0
Run Code Online (Sandbox Code Playgroud)
请注意 - Force参数。强制卸载某个包,即使其他包依赖于它。
或者您可以尝试重新安装Microsoft.ApplicationInsights软件包
Update-Package -Reinstall Microsoft.ApplicationInsights
Run Code Online (Sandbox Code Playgroud)
或者您可以升级所有依赖项Microsoft.ApplicationInsights
Update-Package Microsoft.ApplicationInsights.DependencyCollector -Version 2.5.0
Update-Package Microsoft.ApplicationInsights.PerfCounterCollector -Version 2.5.0
Update-Package Microsoft.ApplicationInsights.Web -Version 2.5.0
Update-Package Microsoft.ApplicationInsights.WindowsServer -Version 2.5.0
Update-Package Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel -Version 2.5.0
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1524 次 |
| 最近记录: |