This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +23
-5
lines changed Expand file tree Collapse file tree 1 file changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -130,12 +130,30 @@ public override void RegisterLicenseFromConfig()
130
130
#elif __IOS__
131
131
#elif __MAC__
132
132
#else
133
- //Automatically register license key stored in <appSettings/>
134
- var licenceKeyText = System . Configuration . ConfigurationManager . AppSettings [ AppSettingsKey ] ;
135
- if ( ! string . IsNullOrEmpty ( licenceKeyText ) )
133
+ string licenceKeyText ;
134
+ try
136
135
{
137
- LicenseUtils . RegisterLicense ( licenceKeyText ) ;
138
- return ;
136
+ //Automatically register license key stored in <appSettings/>
137
+ licenceKeyText = System . Configuration . ConfigurationManager . AppSettings [ AppSettingsKey ] ;
138
+ if ( ! string . IsNullOrEmpty ( licenceKeyText ) )
139
+ {
140
+ LicenseUtils . RegisterLicense ( licenceKeyText ) ;
141
+ return ;
142
+ }
143
+ }
144
+ catch ( Exception ex )
145
+ {
146
+ licenceKeyText = Environment . GetEnvironmentVariable ( EnvironmentKey ) ? . Trim ( ) ;
147
+ if ( string . IsNullOrEmpty ( licenceKeyText ) )
148
+ throw ;
149
+ try
150
+ {
151
+ LicenseUtils . RegisterLicense ( licenceKeyText ) ;
152
+ }
153
+ catch
154
+ {
155
+ throw ex ;
156
+ }
139
157
}
140
158
141
159
//or SERVICESTACK_LICENSE Environment variable
You can’t perform that action at this time.
0 commit comments