Anicho
Anicho

Reputation: 2667

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?

Upvotes: 9

Views: 51377

Answers (2)

Rosdi Kasim
Rosdi Kasim

Reputation: 26036

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.

Upvotes: 5

Strillo
Strillo

Reputation: 2982

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"

Upvotes: 9

Related Questions