Marlon
Marlon

Reputation: 1877

Could not load assembly 'Microsoft.AI.Web'

I have a Asp.net Silverlight application, and suddenly I started to receive the error below when I run the web site:

could not load assembly 'Microsoft.AI.Web' or one of its dependencies...

I did some researching and discovered that this assembly is from ApplicationInsights, but the web site in question has no reference to ApplicationInsight, and no ApplicationInsights.config file, although I have another site in the same solution which has it. This site is edited by another programmer, through a different solution.

As indicated in this answer: Could not load file or assembly 'Microsoft.AI.Web' or one of its dependencies. The system cannot find the file specified, I've tried to install ApplicationInsights using the command:

Install-Package Microsoft.ApplicationInsights.Web

But then I get the following error message when running above command:

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

I don't know if its just coincidence, but I started having this error after Windows 10 installed the Falls creator update.

Edit: I forgot to mention I'm using Visual Studio 2012 Update 5

Upvotes: 3

Views: 6221

Answers (1)

Barrett
Barrett

Reputation: 470

Not sure if you solved this yet but... I had to fix this recently.

In my case, the dependency was inherited from a parent site. If your site is in a sub directory of another site which uses ApplicationInsight but your site does not use ApplicationInsight, you can try removing the dependency by adding the <remove> directive in <system.webServer> <modules> section of your site's web.config:

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

OR

In IIS Manager, select your site (not the parent) in the Sites tree and launch the Modules icon. If ApplicationInsightsWebTracking is shown, right click it and choose Remove.

Upvotes: 17

Related Questions