How to Change Product Key in Visual Studio (Resolve “License Has Expired” Trial Lockout)

When the 30-day or 90-day evaluation period for Microsoft Visual Studio (2022, 2019) concludes, developers are greeted with a modal lockout alert stating “Your evaluation period has ended. Please sign in or unlock with a product key to continue using this product.” You do not need to uninstall the IDE, rebuild your development solutions, or reconfigure SDK workloads. You can instantly unlock your development environment by clicking Unlock with a Product Key inside the Account Settings dialog, entering an authentic 25-character Visual Studio Professional retail license, and activating the software offline or online.
Table of Contents
1. Method 1: Unlock Directly from the Expired Dialog
- When the “Your evaluation period has ended” dialog appears, locate the link at the bottom right labeled Unlock with a Product Key.
- Type your 25-character product key into the field.
- Click Apply. Visual Studio immediately verifies the entitlement and opens your workspace.
2. Method 2: Change Product Key Inside an Active IDE
If your trial has not yet expired and you want to register a permanent retail key:
- In Visual Studio, click Help > About Microsoft Visual Studio.
- Click the Manage License button.
- Click Unlock with a Product Key, enter your key, and click Apply.
3. Method 3: Automated Command-Line Key Injection
For automated enterprise deployment, inject the product key via the Visual Studio Installer command-line:
“C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe” modify –installPath “C:\Program Files\Microsoft Visual Studio\2022\Professional” –productKey “XXXXX-XXXXX-XXXXX-XXXXX-XXXXX” –passive
4. Step 4: Clear Corrupted Licensing Token Cache
If Visual Studio continues asserting that your license is expired despite entering a valid key, clear the local identity cache:
del /q /s “%localappdata%\.IdentityService\*”
Get Genuine Microsoft Visual Studio Perpetual Licenses
Never face trial expiration lockouts again. SortedKeys delivers authentic lifetime licenses for Microsoft Visual Studio 2022 Professional with instant key provisioning.
Buy Visual Studio License →5. Frequently Asked Questions
Can a Visual Studio Professional key unlock Visual Studio Enterprise?
No. Product keys are edition-specific. A Professional key will only activate Visual Studio Professional. If you installed Enterprise, you must either purchase an Enterprise key or reinstall the Professional edition.




