Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit ff65926

Browse files
committed
Init LicenseUtils ctor when JsConfig is first used.
1 parent 828a807 commit ff65926

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/ServiceStack.Text/JsConfig.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ static JsConfig()
1818
//JsConfig<System.Drawing.Color>.SerializeFn = c => c.ToString().Replace("Color ", "").Replace("[", "").Replace("]", "");
1919
//JsConfig<System.Drawing.Color>.DeSerializeFn = System.Drawing.Color.FromName;
2020
Reset();
21+
LicenseUtils.Init();
2122
}
2223

2324
public static JsConfigScope BeginScope()

src/ServiceStack.Text/LicenseUtils.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ static LicenseUtils()
111111
PclExport.Instance.RegisterLicenseFromConfig();
112112
}
113113

114+
private static bool hasInit;
115+
public static void Init()
116+
{
117+
hasInit = true; //Dummy method to init static constructor
118+
}
119+
114120
public static class ErrorMessages
115121
{
116122
private const string UpgradeInstructions = " Please see https://servicestack.net to upgrade to a commercial license or visit https://github.com/ServiceStackV3/ServiceStackV3 to revert back to the free ServiceStack v3.";

0 commit comments

Comments
 (0)