Page 1 of 1

Serial number not shared between DLLs in .NET Framework 4.8

Posted: Tue Jan 13, 2026 10:17 am
by weloveayaka
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?

Re: Serial number not shared between DLLs in .NET Framework 4.8

Posted: Thu Jan 15, 2026 8:27 am
by Admin
You should call VMProtectSetSerialNumber for each module where you use the licensing system.

Re: Serial number not shared between DLLs in .NET Framework 4.8

Posted: Thu Jan 15, 2026 2:09 pm
by weloveayaka
Okay, guess this is the only way. Thank you.