RegisterLicense error

ServiceStack 5.13.2 , .net framework 4.6.1 , windows 7 , used the valid key, occurs the error
Application: dd.khpt.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
   at ServiceStack.Text.JsConfig.Reset()
   at ServiceStack.Text.JsConfig..cctor()

Exception Info: System.TypeInitializationException
   at ServiceStack.Text.JsConfig.InitStatics()
   at ServiceStack.LicenseUtils.RegisterLicense(System.String)
   at ServiceStack.Licensing.RegisterLicense(System.String)
   at LicenseHelper.LicenseServiceStack()
   at AppHost.Start()
   at AppStartup.Init()
   at szldd.khpt.Program.Main()

after installed .net framework 4.8 , It works fine. but I want the .net framework 4.6.1 versoin

As this happens at initialization it’s typically masking the underlying Exception causing the issue like an invalid project dependency or Assembly version, can you put a breakpoint to catch the Exception in a debugger to find out which file/dependency is causing the issue.

every assemlby version is under 4.6.1, only System.Numerics.Vectors is depends on 4.6.2 , last time I used servicestack 5.12, it works fine, Is there any changes between 5.12 to 5.13.2 on initialization?

Yesterday, I tried installed .net framework 4.6.2, It still not work, Installed .net framework 4.7.2, It works fine. But in some other PC, also windows 7 sp1 , only need .net framework 4.6.1 , not any change, works fine, I didn’t know the error, my developer pc is windows 10, didn’t have the Exception, so I can’t catch the exception.

ServiceStack doesn’t have a direct reference to System.Numerics.Vectors. It has nothing to do with the licensing initialization, it’s only manifested there because it’s the first time it attempts deserialization that uses conversion methods which triggers loading System.Numerics.Vectors Assembly which it can’t do because the version it’s trying to load doesn’t match the version your project has installed.

This is a classic .NET Framework Assembly version issue where one of your project references are referencing a different version to the one you have installed so you need to specify and Assembly binding to match the version you have installed

Thanks for your reply, I’m sorry for my mistakes. I used the .net standard version System.Memory.dll to the udpated server, so can’t work. My test pc is the .net framework version System.Memory.dll.

1 Like