42

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

Deeptechtons
  • 10,655
  • 24
  • 92
  • 175
Asim Ilyas
  • 421
  • 1
  • 4
  • 4
  • Possible duplicate of [Could not load file or assembly 'Microsoft.Web.Infrastructure,](http://stackoverflow.com/questions/13149851/could-not-load-file-or-assembly-microsoft-web-infrastructure) – evgenyl Aug 09 '16 at 15:20

5 Answers5

92

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

To run these commands, in Visual Studio open Package Manager by clicking on: Tools -> NuGet Package Manager -> Package Manager Console

Leo
  • 4,748
  • 1
  • 24
  • 62
5

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.

LCJ
  • 21,918
  • 63
  • 246
  • 403
  • 1
    This worked for me! ApplicationInsights.Web was *not* installed, so I installed via NuGet. Automatically added all references. Rebuilt, run, and the error is gone. – dlchambers Jun 04 '20 at 13:18
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

Jambor - MSFT
  • 3,127
  • 1
  • 12
  • 16
1

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

Community
  • 1
  • 1
evgenyl
  • 7,197
  • 2
  • 25
  • 32
0

All the Answers about "Install-Package Microsoft.ApplicationInsights.Web" are not directly solved the Error in my case. My WebApplication-Project did not accept the Installing of the Package (Rollback after a few Minutes of installing).

Then I tried to add the NuGetPacke for Microsoft.ApplicationInsights.Web into a Library-Project, which my WebApplication use. That added the AI.Web-DLLs also to my WebApplication and solved the Problem.

Bhargav Rao
  • 45,811
  • 27
  • 120
  • 136
redM76
  • 41
  • 3