milkshakesoftware/PreMailer.Net

PreMailer 2.0.1 + AngleSharp 0.10.0 = runtime error

DavidDeSloovere opened this issue ยท 10 comments

AngleSharp 0.10.0 was released just a few days ago. Apparently with a breaking change.
Using PreMailer 2.0.1 with AngleSharp 0.10.0 throws a runtime exception. Reverting back to AngleSharp 0.9.11 does not throw the exception.

Could not load type 'AngleSharp.Parser.Html.HtmlParser' from assembly 'AngleSharp, Version=0.10.0.0, Culture=neutral, PublicKeyToken=e83494dcdc6d31ea'.

I think releasing a fix as PreMailer 2.0.2 with requiring AngleSharp at a minimum of 0.10.0 as dependency in the nuspec would be a solution. Might also be best to limit the upper version of AngleSharp below 1.0 (or even keep it fixed at 0.10.0 because it's unstable)

I already checked if AngleSharp can be updated in the PreMailer solution, unfortunately is doesn't support .NET 4.5 anymore (my project is .NET 4.6.1):

Package AngleSharp 0.10.0 is not compatible with net45 (.NETFramework,Version=v4.5). Package AngleSharp 0.10.0 supports:
  - net46 (.NETFramework,Version=v4.6)
  - netstandard2.0 (.NETStandard,Version=v2.0)	PreMailer.Net	C:\Users\david.desloovere\Documents\GitHub\PreMailer.Net\PreMailer.Net\PreMailer.Net\PreMailer.Net.csproj	1	

@martinnormark needs to change code to use NuGet AngleSharp.Css instead of AngleSharp.Parser.Html.HtmlParser

Any update on this issue?

j055 commented

Depending on AngleSharp is hugely problematic until a v1.0.0 is released. I think the only acceptable solution until then is to release a version of PreMailer for each minor and patch release of Anglesharp.

@j055 can you please elaborate?

j055 commented

APIs can change until v1.0.0 is released. https://semver.org/

j055 commented

I've created a pull request #168 which targets Anglesharp 0.11.0

Any news on this?

If this helps anyone, I ended up dropping this dependency by adding all styles into <style> tags in the <head> tag of the email.

@petrosmm I fixed the text, the autoformat feature was removing the tag names from my texts

Latest AngleSharp version is being used now - just published to nuget.