Skip to content

Could not load file or assembly AngleSharp 0.17.0 - .NET 4.8 Issue #578

@ikinetik

Description

@ikinetik

Hi everyone,

I know this has come up several times, so I apologize in advance. I tried installing HtmlSanitizer 9.0.884 which obviously has a dependency on AngleSharp 0.17.1, but AngleSharp.Css is looking for AngleSharp 0.17.0 and hence this error occurs. After multiple attempts, I cannot get this to resolve. I am running .Net 4.8 (old, I know) but this is a project I was just assigned on.

Does anyone have any suggestions? I don't mind downgrading the version of HtmlSanitizer if I need to or using a beta version if it's gonna work.

Thank you in advance! Please let me know if you need any additional information :)

I have tried to update my web.config file as follows hoping the binding redirect would work:
<dependentAssembly> <assemblyIdentity name="AngleSharp" publicKeyToken="e83494dcdc6d31ea" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-0.17.1.0" newVersion="0.17.1.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="AngleSharp.Css" publicKeyToken="e83494dcdc6d31ea" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-0.17.0.0" newVersion="0.17.0.0" /> </dependentAssembly>

Here is the FusionLog:
Pre-bind state information
LOG: DisplayName = AngleSharp, Version=0.17.0.0, Culture=neutral, PublicKeyToken=e83494dcdc6d31ea
(Fully-specified)
LOG: Appbase = file:///D:/myproject/
LOG: Initial PrivatePath = D:\myproject\bin
Calling assembly : AngleSharp.Css, Version=0.17.0.0, Culture=neutral, PublicKeyToken=e83494dcdc6d31ea.

LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\myproject\web.config
LOG: Using host configuration file: C:\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: AngleSharp, Version=0.17.0.0, Culture=neutral, PublicKeyToken=e83494dcdc6d31ea
LOG: Attempting download of new URL file:///C:/Users/AppData/Local/Temp/Temporary ASP.NET Files/vs/0dd9f89c/9d7f6449/AngleSharp.DLL.
LOG: Attempting download of new URL file:///C:/Users/AppData/Local/Temp/Temporary ASP.NET Files/vs/0dd9f89c/9d7f6449/AngleSharp/AngleSharp.DLL.
LOG: Attempting download of new URL file:///D:/myproject/bin/AngleSharp.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Build Number
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions