Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanitize throws MissingMethodException #68

Closed
jfren484 opened this issue May 10, 2016 · 2 comments
Closed

Sanitize throws MissingMethodException #68

jfren484 opened this issue May 10, 2016 · 2 comments

Comments

@jfren484
Copy link

jfren484 commented May 10, 2016

Before updating to the latest version of HtmlSanitizer that uses AngleSharp, HtmlSanitizer was working in my application. After updating, however, calling Sanitize throws an exception. Here is how I'm using it (in an extension method):

        public static string Sanitize(this string htmlString)
        {
            var sanitizer = new HtmlSanitizer();
            return sanitizer.Sanitize(htmlString);
        }

And here are the details:
System.MissingMethodException was unhandled by user code
HResult=-2146233069
Message=Method not found: 'System.String AngleSharp.IMarkupFormattable.ToHtml(AngleSharp.IMarkupFormatter)'.
Source=HtmlSanitizer
StackTrace:
at Ganss.XSS.HtmlSanitizer.Sanitize(String html, String baseUrl, IMarkupFormatter outputFormatter)
at Tcbcsl.Presentation.Helpers.ExtensionMethods.Sanitize(String htmlString) in C:\Users\Jay\Documents\GitHubVisualStudio\Tcbcsl\Presentation\Helpers\ExtensionMethods.cs:line 119
at lambda_method(Closure , NewsEditModel )
at AutoMapper.Internal.DelegateBasedResolver2.Resolve(ResolutionResult source) at AutoMapper.NullReferenceExceptionSwallowingResolver.Resolve(ResolutionResult source) at AutoMapper.PropertyMap.<>c.<ResolveValue>b__44_0(ResolutionResult current, IValueResolver resolver) at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable1 source, TAccumulate seed, Func`3 func)
at AutoMapper.PropertyMap.ResolveValue(ResolutionContext context)
at AutoMapper.Mappers.TypeMapObjectMapperRegistry.PropertyMapMappingStrategy.MapPropertyValue(ResolutionContext context, Object mappedObject, PropertyMap propertyMap)
InnerException:

@304NotModified
Copy link
Contributor

304NotModified commented May 10, 2016

That's a breaking change in AngleSharp (again)

@mganss maybe set a fixed version for AngleSharp in the nuget dependency?

@mganss
Copy link
Owner

mganss commented May 10, 2016

Published a new release (3.2.105).

@304NotModified I've left it as is for now, hoping that they won't change their API again for 1.x. Should this happen again, I'll require a specific version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants