I am having problem with starting ASP.NET MVC5 application. Everything was working fine until now. While starting application I am getting below error:
Could not load file or assembly 'Microsoft.ApplicationInsights, Version=1.2.3.490, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.ApplicationInsights, Version=1.2.3.490, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
I have Microsoft.ApplicationInsights 1.2.3 installed. I also tried clean, rebuild, restart computer, restart computer and leave the room etc etc.
Does someone have any idea how to solve that problem ?
If you have a message like:
Could not load file or assembly '[Any-Package-Name], Version=[Any-Version]
This mean that you have issues with compatibility between different projects. In my case I had the nuget package Microsoft.ApplicationInsights with version 2.8.1 and one of the projects had 2.4. So I got RunTime Error, you need to have the same versions of the nuget packages that you are using in all your projects for not having this errors.
SOLUTION:
Try reinstalling the package using NuGet package manager. Install an updated version if possible.
I installed the new version with Install-Package Microsoft.ApplicationInsights -Version 2.10.0
and I got the same error.
I added this line into Web.config under <runtime><assemblyBinding ...>
and it seems working for me, make sure to have Microsoft.ApplicationInsights.dll
file in the bin folder as well. Good luck.
<dependentAssembly>
<assemblyIdentity name="Microsoft.ApplicationInsights" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.10.0.0" newVersion="2.10.0.0"/>
</dependentAssembly>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With