MailMergeLib icon indicating copy to clipboard operation
MailMergeLib copied to clipboard

Not compatible with SmartFormat v3.0

Open Scantheus opened this issue 3 years ago • 7 comments

MailMergeLib v5.8 SmartFormat v3.0 Framework v4.8

MailMergeMessage mmm = new MailMergeMessage("Subject", "Message");

Gets exception "Method not found: 'Void.SmartFormat.SmartFormatter..ctor()'

Screen-2022-05-12_13-38-36

Scantheus avatar May 12 '22 18:05 Scantheus

Correct, MailMergeLib v5.8 references SmartFormat v2.7.2

axunonb avatar May 12 '22 19:05 axunonb

Then shouldn't nuget dependency be set to SmartFormat.NET = 2.7.2 instead of >= 2.7.2?

Scantheus avatar May 12 '22 19:05 Scantheus

Ah, found the issue. Interesting. I think because my app is targeting NET 4.8, it doesn't take lowest version of dependencies since only NET v4.6.1 is in the MailMergeLib dependencies. I created a blank solution targeting Net 4.6.1 and correct dll versions are downloaded.

Scantheus avatar May 12 '22 19:05 Scantheus

@Scantheus Today we released a new maintenance version of MailMergeLib (v5.8.2), which is available on NuGet. We included an explicit range of compatible versions for dependencies. Does this for for you, too?

axunonb avatar Jun 03 '22 15:06 axunonb

I don't see .NETFramework.Version=v4.8 in the Dependencies.

Scantheus avatar Jun 06 '22 22:06 Scantheus

Tested (and it's a mess to revert back oof). You need NETFramework,Version=v4.8 with the same dependencies you have for v4.6.1. It appears if a framework is not explicitly defined, it will automatically take the latest version of the dependent packages. In this case, it pulls SmartFormat.NET v3.

Scantheus avatar Jun 07 '22 16:06 Scantheus

Couldn't find anything about this behavior here and anywhere else. Thanks again for pointing this out.

axunonb avatar Jun 07 '22 19:06 axunonb

Resolved with #38

axunonb avatar Jun 29 '23 21:06 axunonb