【问题标题】:Could not load assembly 'Microsoft.AI.Web'无法加载程序集“Microsoft.AI.Web”
【发布时间】:2018-05-27 06:15:46
【问题描述】:

我有一个 Asp.net Silverlight 应用程序,当我运行网站时突然开始收到以下错误:

无法加载程序集“Microsoft.AI.Web”或其依赖项之一...

我做了一些研究,发现这个程序集来自 ApplicationInsights,但有问题的网站没有引用 ApplicationInsight,也没有 ApplicationInsights.config 文件,尽管我在同一个解决方案中有另一个站点。此站点由另一位程序员通过不同的解决方案进行编辑。

如此答案所示:Could not load file or assembly 'Microsoft.AI.Web' or one of its dependencies. The system cannot find the file specified,我尝试使用以下命令安装 ApplicationInsights:

Install-Package Microsoft.ApplicationInsights.Web

但是在运行上面的命令时我收到以下错误消息:

Attempting to resolve dependency 'Microsoft.ApplicationInsights (= 2.4.0)'.
Attempting to resolve dependency 'System.Diagnostics.DiagnosticSource (≥ 4.4.0)'.
Install-Package : 'System.Diagnostics.DiagnosticSource' already has a dependency defined for 'System.Collections'.
At line:1 char:1
+ Install-Package Microsoft.ApplicationInsights.Web
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

我不知道这是否只是巧合,但我在 Windows 10 安装 Falls creator 更新后开始出现此错误。

编辑: 我忘了提到我正在使用 Visual Studio 2012 Update 5

【问题讨论】:

    标签: c# asp.net silverlight


    【解决方案1】:

    不确定你是否解决了这个问题,但是...我最近不得不解决这个问题。

    就我而言,依赖项是从父站点继承的。 如果您的站点位于另一个使用 ApplicationInsight 的站点的子目录中,但您的站点不使用 ApplicationInsight,您可以尝试通过在站点的 <system.webServer> <modules> 部分添加 <remove> 指令来删除依赖项网络配置:

    <system.webServer>
        <modules>
           <remove name="ApplicationInsightsWebTracking" />
        </modules>
    </system.webServer>
    

    或

    在 IIS 管理器中,在站点树中选择您的站点(不是父站点)并启动模块图标。如果显示 ApplicationInsightsWebTracking,请右键单击它并选择“删除”。

    【讨论】:

    • 它再次拯救了我的一天!
    猜你喜欢
    • 1970-01-01
    • 2021-03-02
    • 1970-01-01
    • 1970-01-01
    • 2012-01-10
    • 2016-07-05
    • 2016-04-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多