Fix binary compatibility issue with MoveCssInline method signatures #435
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a binary compatibility issue where applications compiled against older versions of PreMailer.Net would fail at runtime with "Method not found" errors when calling
MoveCssInlinemethods.Problem
The issue occurred because the
useEmailFormatterparameter was added to allMoveCssInlinemethod overloads, changing their signatures from:to:
When applications compiled against the old signatures tried to call these methods, the runtime couldn't find the exact method signatures they expected, resulting in
MethodNotFoundException.Solution
Added backward-compatible method overloads that match the old signatures exactly:
Static method overloads for all 4 variants:
MoveCssInline(string html, ...7 params)MoveCssInline(Stream stream, ...7 params)MoveCssInline(Uri baseUri, string html, ...8 params)MoveCssInline(Uri baseUri, Stream stream, ...8 params)Instance method overload:
MoveCssInline(...7 params)All backward-compatible overloads delegate to the corresponding new methods with
useEmailFormatter = false, preserving the original behavior.Testing
This ensures applications compiled against any version of PreMailer.Net will continue to work without recompilation.
Fixes #434.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.