Closed kampilan closed 2 years ago
Hi, in most cases, such issues which are hard to track have their reason in
SmartSettings.IsThreadSafeMode
is not set to true
in a multi-threaded / async context.
That's why SmartSettings.IsThreadSafeMode
defaults to true
in v3.1.0
.
Also, static Smart.Format(...)
could not be used with multi-threading in v3.0.0, because it used a single static SmartFormatter
instance.
in v3.1.0
Smart.Format(...)
uses a ThreadStatic
instance of the SmartFormatter
.
See more in the current Wiki chapter for v3.1.0
This is happening intermittently. Perhaps 1 out of 50 times. This might not be totally accurate but it feels like it happens more after the app has been idle for a while. I have no evidence of that. Just a feeling.
Thanks Jim
Smart.Format 3.0.0:
Framework version: net6.0
Exception: SmartFormat.Core.Parsing.ParsingErrors - The format string has 1 issue: '0x3D': Invalid character in the selector In: "host=production-2.cluster-XXXXXXXXXX.us-east-1.rds.amazonaws.com; database=connect_v3_prod;user id={ReplicaDbUserName};password={ReplicaDbPassword};AllowUserVariables=true;" At: ----------------------------------------------------------------------------------------------------------------------------------^
at SmartFormat.Core.Parsing.Parser.HandleParsingErrors(ParsingErrors parsingErrors, Format currentResult) at SmartFormat.Core.Parsing.Parser.ParseFormat(String inputFormat) at SmartFormat.SmartFormatter.Format(IFormatProvider provider, String format, IList`1 args)
var legacy = Smart.Format(LegacyDbConnectionTemplate, secrets);
public class SecretsModel {
}