mganss / HtmlSanitizer

Cleans HTML to avoid XSS attacks
MIT License
1.52k stars 198 forks source link

I updated to the latest HtmlSanitizer - 8.0.746 and it won't run #492

Closed rgoodman1977 closed 7 months ago

rgoodman1977 commented 8 months ago

I am getting this error when trying to load the sanitizer:

image

I can't see anything referencing AngleSharp, Version=0.17.0.0'

This is what my nuget screen look like right now:

image

Any advice? Thanks

tiesont commented 8 months ago

What version of .NET does your project target? If there's an app.config or web.config, make sure that the assembly reference is correct. If this project references other projects which also reference AngleSharp for whatever reason, make sure that they target the same version.

Beyond that... I'm using HtmlSanitizer in a .NET6 project with no issues, so it's something about your setup.

mganss commented 7 months ago

I'm going to close this for now.

Arjanvanmaren commented 7 months ago

This fixed it for me, adding this to my web config of the project.

<dependentAssembly> 
    <assemblyIdentity name="AngleSharp" publicKeyToken="e83494dcdc6d31ea" culture="neutral"/> 
    <bindingRedirect oldVersion="0.0.0.0-0.17.1.0" newVersion="0.17.1.0"/> 
 </dependentAssembly>