Turboactivate for a .NET Core application?

We've been using Turboactivate for years now, and have been happy with the product. But now we want to move from C# on .NET to .NET Core to support Mac OS and Linux as well.How should we implement Turboactivate in this case?

As of TurboActivate 4.0.x we do not have a .NET Core example bundled with the API packs for the different platforms. We do plan on adding it (likely to version TA 4.2).

In the meantime there are a couple of things you should know:

1. TurboActivate already supports Windows, macOS, Linux.

2. The TurboActivate class can be compiled in .NET Core. (But "compiling" is different that "functioning" ... see step 3).

3. You'll have to minimally modify the class to call the TurboActivate.dll on Windows, libTurboActivate.dylib on macOS, and libTurboActivate.so on Linux.

Thanks for the quick Responce.

Alright, so I made changes to TurboActivate.cs to accomodate libTurboActivate.so and libTurboActivate.dylib.Now I am using PDetsFromPath() to load TurboActivate.dat (as suggested by another thread), and that works fine on windows, but when I test it on linux, I get a ProductDetailsException, saying that the TurboActivate.dat is either missing or corrupted.Do I need seperate versions of TurboActivate.dat for linux and mac?

You need to use Charset.Ansi for PInvoke calls on Linux/macOS because the TurboActivate API on those platforms accepts UTF-8 strings not UTF-16 (double-byte character) strings.

Thanks! I'd of course forgotten to change that.

Wyatt wrote:> You need to use Charset.Ansi for PInvoke calls on Linux/macOS because the> TurboActivate API on those platforms accepts UTF-8 strings not UTF-16> (double-byte character) strings.

HI Wyatt

do you mean when i import so file [DllImport("libTurboActivate.so", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]

I get a ProductDetailsException, saying that the TurboActivate.dat is either missing or corrupted.

Can you please let me know which method i have to change to use Charset.Ansi

TurboActivateVersionGuidInit(); => TurboActivate.VersionGUID = sVersionGUID;

TurboActivate.PDetsFromPath("/tmp/TurboActivate.dat"); retrun TA_OK: // successful

After TurboActivate.IsActivated();

public static bool IsActivated() { #if TA_BOTH_DLL switch (IntPtr.Size == 8 ? Native64.IsActivated(VersionGUID) : Native.IsActivated(VersionGUID)) #else switch (Native.IsActivated(VersionGUID)) #endif { case TA_E_GUID: throw new GUIDMismatchException(); case TA_E_PDETS: throw new ProductDetailsException(); it fails here !!!!! case TA_E_COM: throw new COMException(); case TA_E_IN_VM: throw new VirtualMachineException(); case TA_OK: // is activated return true; }

return false; }What I'm doing wrong ?

I\m using Ubuntu 18.04 on windows it was working

Thanks in advance

>> "Can you please let me know which method i have to change to useCharset.Ansi"

You have to do it for every single function.

Also, because you're on Unix, you'll need to explicitly load the TurboActivate.dat file using TA_PDetsFromPath() before calling *any* other function.

Hi

Thanks Wyatt for suggestions, but i got meanwhile another blocker

After i loaded dat file and i wana activate a customer with online activation Native.TA_IsActivated(handle) return 27

On linux i compile without TA_BOTH_DLL

what it means code 27 ? Thanks in advance

TurboActivate.h includes all error codes (in decimal and hexadecimal) and full descriptions:

/* MessageId: TA_E_INVALID_HANDLE Message code (in Hex): 0x1B Message code (in Decimal): 27

MessageText:

The handle is not valid. To get a handle use TA_GetHandle().*/#define TA_E_INVALID_HANDLE ((HRESULT)0x0000001BL)

Thanks for the quick Responce.