Serial number not shared between DLLs in .NET Framework 4.8

Hello!

Environment:

  • .NET Framework 4.8
  • VMProtect with .NET SDK
  • Using VirtualizationLockByKey feature

Scenario:

  • A.DLL calls VMProtect.SDK.SetSerialNumber(xxx)
  • B.DLL references A.DLL (either by assembly reference or reflection)
  • Both A.DLL and B.DLL use the same LicenseDataFile
  • Both DLLs have methods protected with VirtualizationLockByKey

Problem:
B.DLL cannot access the serial number set by A.DLL:

  • GetSerialNumberData() in B.DLL returns empty/null without calling SetSerialNumber in B.DLL
  • VirtualizationLockByKey protected methods in B.DLL also fail

Expected behavior:
I want to call SetSerialNumber once in A.DLL, and have it work for the entire process: (if and only if they are using the same LicenseDataFile):

  • GetSerialNumberData() should work in all DLLs
  • VirtualizationLockByKey protected methods should work in all DLLs

Question:
In .NET Framework 4.8, is SetSerialNumber supposed to be process-wide or assembly-specific?
Is there a way to make the serial number accessible across all DLLs in the same process?
Or do I have to call SetSerialNumber separately in each DLL?

You should call VMProtectSetSerialNumber for each module where you use the licensing system.

Okay, guess this is the only way. Thank you.