[visual-studio-2012] How to change Visual Studio 2012,2013 or 2015 License Key?

I have a Copy of Visual Studio 2012 Pro on my machine with a Serial key that i'm no longer suppose to use because i have to use another one. My problem is i keep Uninstalling Visual studio but the Registration information is still there after re-install and i cannot figure out which registry path i have to delete (i deleted a few) with no luck.

Is there a easy way to remove tha reg info or swap my keys?

Thanks

The answer is


See my UPDATE at the end, before reading the following answer.

I have windows 8 and another pc with windows 8.1

I had License error saying "Prerelease software. License expired".

The only solution that I found which is inspired by the above solutions (Thanks!) was to run process monitor and see the exact registry keys that are accessed when I start the VS2013 which were:

HKCR\Licenses\E79B3F9C-6543-4897-BBA5-5BFB0A02BB5C

like what are mentioned in the previous posts. However the process monitor said that this registry is access denied.

So I opened regedit and found that registry key and I could not open it. It says I have no permission to see it.

SO I had to change its permission:

  1. Right click on the "HKCR\Licenses\E79B3F9C-6543-4897-BBA5-5BFB0A02BB5C" key
  2. Permissions
  3. Add
  4. In "Enter object names to select" I have added my windows user name. Ok.
  5. check on Full control
  6. Advanced
  7. Owner click on "Change"
  8. In "Enter object names to select" I have added my windows user name. Ok.
  9. Ok. Ok. Ok.

I found that this registry key has several sub keys, however you have to restart regedit to see them.

By seeing which other registry keys are access denied in process monitor , I knew that VS2013 will specifically deal with these subkeys which are ACCESS DENIED also: 06181 0bcad

and these subkeys should be changed their permissions as well like above.

After making these permission changes everything worked well.

The same thing has been done to Microsoft visual studio 2010 because an error in the license as well and the solution worked well.

UPDATE : It turned out that starting visual studio as administrator solved this issue without this registry massage. Seems that this happened to my pc after changing the 'required password to login' removed in the user settings. (I wanted to let the pc start running without any password after restart from a crash or anything else). This made a lot of programs not able to write into some folders like temp folders unless I start the application as admin. Even printing from excel would not work, if excel is not started as admin.


The ISO is probably pre-pidded. You'll need to delete the key from the setup files. It should then ask you for a key during installation.


The solution with removing the license information from the registry also works with Visual Studio 2013, but as described in the answer above, it is important to execute a "repair" on Visual Studio.


For me, with Visual Studio 2013, it wasn't enough to remove the license key and perform a repair (the repair restored the license key instead of reverting to a trial, and running it without the repair (after deleting the key) claimed the license had expired but wouldn't let me enter a new key).

I had to:

  • Discover what license key Visual Studio was looking for in the registry with Process Monitor (it was HKCR\Licenses\E79B3F9C-6543-4897-BBA5-5BFB0A02BB5C)
  • Completely uninstall Visual Studio 2013 (save CurrentSettings.vssettings first)
  • Delete the license key from the registry by hand in regedit
  • Install Visual Studio using the publicly available web installer (which doesn't have any baked-in license key -- it installs a 30-day trial)
  • Enter my new license key
  • (Re-)install updates (Update 1 at this time)
  • Restore settings by importing the backup I made of CurrentSettings.vssettings

For those who will need to remove product key from Visual Studio 2015:

  1. remove registry key HKCR\Licenses\4D8CFBCB-2F6A-4AD2-BABF-10E28F6F2C8F
  2. repair Visual Studio installation

That's it, now you can change the product key if necessary.


I had the same problem and wanted to change the product key to another. Unfortunate it's not as easy as it was on VS2010.

The following steps work:

  • Remove the registry key containing the license information: HKEY_CLASSES_ROOT\Licenses\77550D6B-6352-4E77-9DA3-537419DF564B

  • If you can't find the key, use sysinternals ProcessMonitor to check the registry access of VS2012 to locate the correct key which is always in HKEY_CLASSES_ROOT\Licenses

  • After you remove this key, VS2012 will tell you that it's license information is incorrect. Go to "Programs and features" and repair VS2012.

  • After the repair, VS2012 is reverted to a 30 day trial and you can enter a new product key. This could also be used to stay in a trial version loop and never enter a producy key.


For those of you using Visual Studio 2017 Professional, the registry key is:

HKCR\Licenses\5C505A59-E312-4B89-9508-E162F8150517

I also recommend you first export the registry key, before you delete it, so you'll have a backup if you accidentally delete the wrong key.


To see what's inside these HKCR\Licenses use API Monitor v2

API-Filter find 

    RegQueryValueExW 
        ^-Enable all from Advapi32.dll

    CryptUnprotectData
        ^- Enable all from Crypt32.dll
         + Breakpoint / after Call

sample data that'll come out from CryptUnprotectData:

HKEY_CLASSES_ROOT\Licenses\4D8CFBCB-2F6A-4AD2-BABF-10E28F6F2C8F\07078  [length 0x1C6 (0454.) ]
    00322-20000-00000-AA450                 <- PID2
    7d3cbcbb-90b1-411f-9981-6e28039a9b82    <- Ver
    7C3WXN74-VRMXH-J8X3H-M8F7W-CPQB8        <- PID3

HKEY_CLASSES_ROOT\Licenses\4D8CFBCB-2F6A-4AD2-BABF-10E28F6F2C8F\0bcad  [length 0xbcad (0534.) ]

    0000  00000025 ffffffff 7fffffff   07064. 00000007   07078. 00000007 ffffffff
    0020  7fffffff ffffffff 7fffffff ffffffff 7fffffff ffffffff 7fffffff ffffffff
    0040  7fffffff ffffffff 7fffffff ffffffff 7fffffff ffffffff 7fffffff ffffffff
    0060  7fffffff ffffffff 7fffffff ffffffff 7fffffff ffffffff 7fffffff ffffffff
    0080  7fffffff ffffffff 7fffffff ffffffff 7fffffff ffffffff 7fffffff ffffffff
    00a0  7fffffff ffffffff 7fffffff ffffffff 7fffffff ffffffff 7fffffff ffffffff
    00c0  7fffffff ffffffff 7fffffff ffffffff 7fffffff ffffffff 7fffffff ffffffff
    00e0  7fffffff ffffffff 7fffffff ffffffff 7fffffff ffffffff 7fffffff ffffffff
    0100  7fffffff ffffffff 7fffffff ffffffff 7fffffff ffffffff 7fffffff ffffffff
    0120  7fffffff ffffffff 7fffffff 10.2015. c2a6 11.
    0134                             ^installation date^

Useful here is maybe the Installation timestamp (11.10.2015 here ) Change this would required to call 'CryptProtectData'. Doing so needs some efforts like written a small program OR stop with ollydebug at this place and manually 'crafting' a CryptProtectData call ...

Note: In this example I'm using Microsoft® Visual Studio 2015

-> For a quick'n'dirty sneak into an expired VS I recommend to read this post. However that's just good for occasional use, till you get all the sign up and login crap properly done again ;)

Okay the real meat is here:
%LOCALAPPDATA%\Microsoft\VisualStudio\14.0\Licenses\ ^- This path comes from HKCU\Software\Microsoft\VisualStudio\14.0\Licenses\715f10eb-9e99-11d2-bfc2-00c04f990235\1

1_3jdh3uyw**.crtok**

-after some Base64 decoding:

<ClientRightsContainer 
    xmlns="http://schemas.datacontract.org/2004/07/Microsoft.VisualStudio.Services.Licensing" 
    xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <CertificateBytes>
        00000000   30 82 06 41 30 82 04 29  A0 03 02 01 02 02 13 5A   0‚ A0‚ )       Z
        00000010   00 00 BC CB 23 AC 52 9C  E8 93 F9 0A 00 01 00 00     ¼Ë#¬Rœè“ù     
        00000020   BC CB 30 0D 06 09 2A 86  48 86 F7 0D 01 01 0B 05   ¼Ë0   *†H†÷     
        00000030   00 30 81 8B 31 0B 30 09  06 03 55 04 06 13 02 55    0 ‹1 0   U    U
        00000040   53 31 13 30 11 06 03 55  04 08 13 0A 57 61 73 68   S1 0   U    Wash
        00000050   69 6E 67 74 6F 6E 31 10  30 0E 06 03 55 04 07 13   ington1 0   U   
        00000060   07 52 65 64 6D 6F 6E 64  31 1E 30 1C 06 03 55 04    Redmond1 0   U 
        00000070   0A 13 15 4D 69 63 72 6F  73 6F 66 74 20 43 6F 72      Microsoft Cor
        00000080   70 6F 72 61 74 69 6F 6E  31 15 30 13 06 03 55 04   poration1 0   U 
        00000090   0B 13 0C 4D 69 63 72 6F  73 6F 66 74 20 49 54 31      Microsoft IT1
        000000A0   1E 30 1C 06 03 55 04 03  13 15 4D 69 63 72 6F 73    0   U    Micros
        000000B0   6F 66 74 20 49 54 20 53  53 4C 20 53 48 41 32 30   oft IT SSL SHA20
        000000C0   1E 17 0D 31 35 30 33 30  35 32 31 32 39 35 36 5A      150305212956Z
        000000D0   17 0D 31 37 30 33 30 34  32 31 32 39 35 36 5A 30     170304212956Z0
        000000E0   25 31 23 30 21 06 03 55  04 03 13 1A 61 70 70 2E   %1#0!  U    app.
        000000F0   76 73 73 70 73 2E 76 69  73 75 61 6C 73 74 75 64   vssps.visualstud
        00000100   69 6F 2E 63 6F 6D 30 82  01 22 30 0D 06 09 2A 86   io.com0‚ "0   *†
        ...
        000002B0   6E 86 36 68 74 74 70 3A  2F 2F 6D 73 63 72 6C 2E   n†6http://mscrl.
        000002C0   6D 69 63 72 6F 73 6F 66  74 2E 63 6F 6D 2F 70 6B   microsoft.com/pk
        000002D0   69 2F 6D 73 63 6F 72 70  2F 63 72 6C 2F 6D 73 69   i/mscorp/crl/msi
        000002E0   74 77 77 77 32 2E 63 72  6C 86 34 68 74 74 70 3A   twww2.crl†4http:
        000002F0   2F 2F 63 72 6C 2E 6D 69  63 72 6F 73 6F 66 74 2E   //crl.microsoft.
        00000300   63 6F 6D 2F 70 6B 69 2F  6D 73 63 6F 72 70 2F 63   com/pki/mscorp/c
        00000310   72 6C 2F 6D 73 69 74 77  77 77 32 2E 63 72 6C 30   rl/msitwww2.crl0
        00000320   70 06 08 2B 06 01 05 05  07 01 01 04 64 30 62 30   p  +        d0b0
        00000330   3C 06 08 2B 06 01 05 05  07 30 02 86 30 68 74 74   <  +     0 †0htt
        00000340   70 3A 2F 2F 77 77 77 2E  6D 69 63 72 6F 73 6F 66   p://www.microsof
        00000350   74 2E 63 6F 6D 2F 70 6B  69 2F 6D 73 63 6F 72 70   t.com/pki/mscorp
        00000360   2F 6D 73 69 74 77 77 77  32 2E 63 72 74 30 22 06   /msitwww2.crt0" 
        00000370   08 2B 06 01 05 05 07 30  01 86 16 68 74 74 70 3A    +     0 † http:
        00000380   2F 2F 6F 63 73 70 2E 6D  73 6F 63 73 70 2E 63 6F   //ocsp.msocsp.co
        00000390   6D 30 4E 06 03 55 1D 20  04 47 30 45 30 43 06 09   m0N  U   G0E0C  
        000003A0   2B 06 01 04 01 82 37 2A  01 30 36 30 34 06 08 2B   +    ‚7* 0604  +
        000003B0   06 01 05 05 07 02 01 16  28 68 74 74 70 3A 2F 2F           (http://
        000003C0   77 77 77 2E 6D 69 63 72  6F 73 6F 66 74 2E 63 6F   www.microsoft.co
        000003D0   6D 2F 70 6B 69 2F 6D 73  63 6F 72 70 2F 63 70 73   m/pki/mscorp/cps
        000003E0   00 30 27 06 09 2B 06 01  04 01 82 37 15 0A 04 1A    0'  +    ‚7    
        000003F0   30 18 30 0A 06 08 2B 06  01 05 05 07 03 01 30 0A   0 0   +       0 
        00000400   06 08 2B 06 01 05 05 07  03 02 30 25 06 03 55 1D     +       0%  U 
        00000410   11 04 1E 30 1C 82 1A 61  70 70 2E 76 73 73 70 73      0 ‚ app.vssps
        00000420   2E 76 69 73 75 61 6C 73  74 75 64 69 6F 2E 63 6F   .visualstudio.co
        00000430   6D 30 0D 06 09 2A 86 48  86 F7 0D 01 01 0B 05 00   m0   *†H†÷      
        ...                                                U
    </CertificateBytes>
    <Token>
    {
        "typ":"JWT",
        "alg":"RS256",
        "x5t":"i7qX-NUrehXBYdQC5PSH-TdvzXA"
    }
    </Token>
</ClientRightsContainer>

Seems M$ is using JSON Web Token (JWT) to wrap in license data. I guess inside CertificateBytes will be somehow the payload - you're email and other details.

So far for the rough overview what's the data inside.

For more wishes get ILSpy + Reflexil (<- to changes/correct little things!) and then 'browser&correct' files like c:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE**Microsoft.VisualStudio.Licensing.dll** or check out 'Microsoft.VisualStudio.Services.WebApi.dll'


Examples related to visual-studio-2012

How to actually search all files in Visual Studio Tests not running in Test Explorer How to use _CRT_SECURE_NO_WARNINGS Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=11.0.0.0 How can I resolve the error: "The command [...] exited with code 1"? Could not load file or assembly Exception from HRESULT: 0x80131040 MSVCP120d.dll missing How can I change IIS Express port for a site The program can't start because MSVCR110.dll is missing from your computer Controlling execution order of unit tests in Visual Studio

Examples related to visual-studio-2013

Microsoft Advertising SDK doesn't deliverer ads Visual Studio 2013 error MS8020 Build tools v140 cannot be found Visual Studio 2013 Install Fails: Program Compatibility Mode is on (Windows 10) 'cannot find or open the pdb file' Visual Studio C++ 2013 Force uninstall of Visual Studio How to enable C# 6.0 feature in Visual Studio 2013? Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE] even if app appears to not be installed Process with an ID #### is not running in visual studio professional 2013 update 3 Error C1083: Cannot open include file: 'stdafx.h' The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)"

Examples related to visual-studio-2015

How to download Visual Studio Community Edition 2015 (not 2017) The default XML namespace of the project must be the MSBuild XML namespace tsconfig.json: Build:No inputs were found in config file How to install Visual C++ Build tools? Could not load file or assembly "System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" How to unapply a migration in ASP.NET Core with EF Core The term "Add-Migration" is not recognized Visual Studio 2015 Update 3 Offline Installer (ISO) Getting "project" nuget configuration is invalid error ASP.NET 5 MVC: unable to connect to web server 'IIS Express'