0

In my ServiceStack client application, everything was fine until I have tried packaging it with SmartAssembly or ILRepack. There are three DLLs: (ServiceStack.Client.dll, ServiceStack.Interfaces.dll, ServiceStack.Text.dll) Which when packed cause my application to crash, no matter whether I use encryption\obfuscation options or just pack them into one EXE. My app is targeting .NET 4.0 (I want to support win XP). Stack trace of the exception is:

ServiceStack.LicenseException: Unauthorized access request of a licensed feature. Type: 'AccessToken', Assembly: 'ClientTester.exe', 'My EXE path'
ServiceStack.Net40PclExport.VerifyInAssembly(Type accessType, ICollection`1 assemblyNames)
ServiceStack.LicenseUtils.RequestAccess(Object accessToken, LicenseFeature srcFeature, LicenseFeature requestedAccess)
ServiceStack.JsonServiceClient.ToJson[T](T o)
ServiceStack.EncryptedServiceClient.CreateEncryptedMessage(Object request, String operationName, Byte[] cryptKey, Byte[] authKey, Byte[] iv, String verb)
ServiceStack.EncryptedServiceClient.Send[TResponse](String httpMethod, Object request)

I can't install the patch as the installer says that it is blocked or the conditions are invalid. In addition, I am not sure that this patch would help me. Any ideas are welcome.
Sidenote: another ServiceStack application, which uses other ServiceStack DLLs except aforementioned ones works well even when packed.

HardLuck
  • 1,497
  • 1
  • 22
  • 43
  • Have you added your license key to your `app.config`? – will Mar 06 '16 at 16:17
  • This is client app and it does not require license (I believe). In addition, as I mentioned the issue appears only if i merge all assemblies into my exe, normally there are no issues. – HardLuck Mar 06 '16 at 16:24
  • @HardLuck can you retry with the latest v4.0.55 packages on [MyGet](https://github.com/ServiceStack/ServiceStack/wiki/MyGet)? – mythz Mar 06 '16 at 17:08
  • I'm using the latest packages from MyGet (including the commit where CookieContainer got fixed), or there is another commit now? – HardLuck Mar 06 '16 at 17:22
  • @HardLuck you need to get the latest v4.0.55 again. i.e. delete `/packages`, delete `%LOCALAPPDATA%\NuGet\Cache\`, reopen VS Solution and restore NuGet packages so it pulls down the latest version. – mythz Mar 06 '16 at 17:25
  • Dropped packages cache and loaded the latest version - still the same – HardLuck Mar 06 '16 at 17:28
  • @HardLuck I'm surprised it's the same error, only other thing I can think of is to register a license key which you can [register in code with option b)](https://servicestack.net/download#register) – mythz Mar 06 '16 at 17:32
  • That's really strange and sad at the same time as i haven't exceeded any of free quotas, thanks anyway – HardLuck Mar 06 '16 at 17:46

1 Answers1

1

It looks like the absence of an explicitly installed .NET Framework 4.0 is causing that issue. If I compile the solution for 4.5\4.6 version and pack it - everything is fine. Also compiling and packing it for .NET 4.0 and using it on PC that EXPLICITLY has this version installed works as well

HardLuck
  • 1,497
  • 1
  • 22
  • 43