JavaEar 专注于收集分享传播有价值的技术资料

无法加载文件或程序集" Microsoft.AI.Web" 或其依赖项之一。该系统找不到指定的文件 (Could not load file or assembly 'Microsoft.AI.Web' or one of its dependencies. The system cannot find the file specified)

After successfully publishing my Web Api to Azure when i try to hit the api i get the following error.

Here's a link to api

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.

Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

3个回答

    最佳答案

  1. 英文原文

    I solved this problem by doing this:

    Install-Package Microsoft.ApplicationInsights.Web
    

    To install Application Insights only to the Web/API Project:

    Install-Package Microsoft.ApplicationInsights.Web YourProjectName
    

    中文翻译

    我通过这样做解决了这个问题:

      Install-Package Microsoft.ApplicationInsights.Web
     

    仅将Application Insights安装到Web / API项目:

      Install-Package Microsoft.ApplicationInsights.Web YourProjectName
     

    I solved this problem by doing this:

    Install-Package Microsoft.ApplicationInsights.Web
    

    To install Application Insights only to the Web/API Project:

    Install-Package Microsoft.ApplicationInsights.Web YourProjectName
    

    我通过这样做解决了这个问题:

      Install-Package Microsoft.ApplicationInsights.Web
     

    仅将Application Insights安装到Web / API项目:

      Install-Package Microsoft.ApplicationInsights.Web YourProjectName
     
  2. 参考答案2
  3. I have reproduce this type issue. Here is my reproduce process:

    1) Create web App api with Microsoft.ApplicationInsights.Web installed.
    2) Then deploy the App to Azure Web app.
    

    Here is the web API worked screenshot: enter image description here

    Then I open KUDU tool, delete Microsoft.AI.Web in Bin folder, and run the site again. I get the same error with you, here is the screenshot: enter image description here

    So I can ensure that, this error is caused by the assembly Microsoft.AI.Web is missing. Please set the copy local as true as following screenshot, then redeploy to Azure web App: enter image description here

  4. 参考答案3