Closed shawndotey closed 5 years ago
Just checked with v2.3.1 and .Net Framework 4.5.1 in a new project: cannot reproduce the false output, sorry. Please try your test with
Smart.Default.Settings.FormatErrorAction = ErrorAction.ThrowError;
Smart.Default.Settings.ParseErrorAction = ErrorAction.ThrowError;
and you will get an exception with more details.
Did catching the exception shed some light into your issue?
Closing after no response
Sorry but I do not have time to test, I am using 2.2.0 instead.
I know this is a closed topic, but in case it helps anyone who googles their way here, I had a similar issue after using Nuget to get MailMergeLib (which has SmartFormat as a dependency) - in dev everything was happy but on deploying the merge fields output empty strings.
Initially, I thought the problem was with that library, so used SmartFormat directly but still had the same issue. After turning on the errors, I got "Could not load file or assembly 'Newtonsoft.Json, Version=11.0.0.0 ..." It seems to be that 2.3.0 and 2.3.1.1 is expecting to use Newtonsoft.Json 11 wheras my application was using Newtonsoft.Json 12.0.1
I was able to get SmartFormat working by upgrading to latest version (2.4.1), which also expect to use Newtonsoft.Json 12.0.1
Thanks a lot for this very useful hint
2.3 or Above Running on .NET Framework 4.5.1
From your documentation:
Should Output:
"Jim from New York, NY"
Outputs:" from , "
2.2.0 Works as expected.
Thanks!