Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception from HRESULT: 0x80131040

Warning 1   D:\MyPath\SomeAscx.cs: ASP.NET runtime error: 


            Could not load file or assembly 'HtmlAgilityPack, 
            Version=1.4.0.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a'
            or one of its dependencies. The located assembly's manifest definition 
            does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I have removed the reference and am not using it in code why would this still be an issue. I have tried cleaning solution, rebuilding, open and closing solution but still no success. Has anyone come across this issue before?

like image 950
Anicho Avatar asked Feb 03 '12 14:02

Anicho


2 Answers

Even if you removed direct references, something else might still require that dll.

I'd suggest:

  1. Recycle your IIS application pool (or run IISRESET from the command prompt to reset the entire web server)
  2. turn on FusLog and check who is the real "offender"
like image 181
Strillo Avatar answered Nov 06 '22 05:11

Strillo


This can happen if your project name conflicts with a nuget package you referenced. I wasted about 30 minutes before I realized what is going on.

I was doing a ReactJS tutorial, so I created a project called React, and then later I imported ReactJS.NET from nuget.

When I hit build, Visual Studio will build React.dll in bin folder since my project name is React, this dll overwrites the React.dll imported by nuget package ReactJS.NET

So my project blew up... and I wasted 30 minutes scratching my head.

like image 23
Rosdi Kasim Avatar answered Nov 06 '22 07:11

Rosdi Kasim