Could not load file or assembly 'Microsoft.AI.

2020-02-26 03:34发布

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

4条回答
The star\"
2楼-- · 2020-02-26 03:56

Using "Manage NuGet Packages" I tired to install Microsoft.ApplicationInsights.Web. It was already installed. I gave an "Update". After rebuild application, the error is gone.

查看更多
倾城 Initia
3楼-- · 2020-02-26 03:56

Pls, check this answer:

You will need to include the dll with your project and add a reference to it as well.

Here is a link to a similar issue already on Stack: MVC3 Deployment Dependency Problems

查看更多
爱情/是我丢掉的垃圾
4楼-- · 2020-02-26 04:05

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
查看更多
Evening l夕情丶
5楼-- · 2020-02-26 04:20

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

查看更多
登录 后发表回答