Thursday, August 11, 2016

MSDN and Installing Visual Studio 2015 Enterprise - An Identity Management Dumpster Fire

About 30-90 days after you install Visual Studio 2015 Enterprise, you may notice that your "trial version" is expiring.

"But, wait!" You say. "My company has an MSDN subscription!  They pay Microsoft so that I don't have to mess around with trial versions of Microsoft stuff!"

Well, sit down, partner.  This is probably going to take a while.

"But, wait!" You say. "Can't I just reinstall Visual Studio and avoid this pain and suffering?"

Nope.

"But, wait!" You say. "What about a Visual Studio repair to avoid this pain and suffering?"

Nope.  Not unless you root around in your registry on your work machine.

Let's get started.

**Visual Studio 2015 "stuck in trial mode" --  fix steps:**

Assumptions: You have a work email address and have the appropriate MSDN license.

+ Go to the MSDN my account page (https://msdn.microsoft.com/en-us/subscriptions/manage/) and link your VS Team services account to your work account by clicking "link my work account to Visual Studio Team Services".

+ Close Visual Studio.

+ Per this stack overflow answer (http://stackoverflow.com/a/32482322/446746), delete the registry
 keys in this directory with regedit: `HKEY_CLASSES_ROOT\Licenses\4D8CFBCB-2F6A-4AD2-BABF-10E28F6F2C8F`

+ Open Control Panel-> Uninstall a Program -> Find Visual Studio Enterprise 2015. Double-click it, but select "repair" instead of uninstall. This took about 90 minutes to complete. This should unlink the "profile" from the visual studio install.

+ Open Visual Studio. Go to "File"->"Account Settings" - Notice that the license isn't linked anymore, even if it claims to be a 30 day trial.

+ Click "Check for an updated license". Watch the updated license actually update Visual Studio and finally recognize the MSDN Subscription.

+ Bask in troubleshooting glory.

"But, wait!" You say. "I'm new at {company name}, a company has an MSDN subscription!  They pay Microsoft so that I don't have to mess around with trial versions of Microsoft stuff!  I have been warned of this problem by someone who has spent hours troubleshooting this, and would like to avoid their pain and suffering!  What's the right way to do this?"

**Getting Visual Studio 2015 Enterprise installed correctly the first time**

+ You need to create a Microsoft account.  One way to do this is to go to the MSDN Downloads page (https://msdn.microsoft.com/en-us/subscriptions/downloads/), and try to select "My Account", which will force you to sign in.  Choose "Sign up now" where it says "Don't have a Microsoft Account?"

+ Respond to the email confirmation upon creating the account.

+ Your Internal IT will confirm that they wish to invite you to the MSDN organization.

+ You will receive an email from Microsoft to your work email address (firstname.lastname@workplace.com), likely titled "Invitation to Associate with a Member Organization", which contains a link that will help you start the process of associating your accounts.  Follow that link and do everything that it asks.

+ You will likely receive an email from Microsoft that confirms your assignment to a role in your organization.

+ You may also receive a separate email from Microsoft confirming that you've associated to a Microsoft Partner Network Member organization.

+ Wait a couple business days for Microsoft to update its own servers.

+ Attempt to add your subscription to the account that Microsoft has already recognized by using this link: (https://msdn.microsoft.com/subscriptions/add/default.aspx)

+ If you have not received a Technical ID from Microsoft, you cannot continue until Microsoft has processed everything and assigned you a Technical ID.  This ID is different from the Organization Partner ID (probably seven digits) and the Location Partner ID (probably a different seven digits).  The Technical ID is unique to you.  It may come in an email to either you or Internal IT, and it will often take 2-3 business days to arrive.

+ Once you have received a Technical ID from Microsoft, attempt again to add your subscription to the account that Microsoft has already recognized by using this link: (https://msdn.microsoft.com/subscriptions/add/default.aspx).

+ It is possible (or probable) that Microsoft has not updated their own servers with the Technical ID that they themselves have just provided to you.  You may need to wait 2-3 more business days for Microsoft to update their own servers again.  The only way to determine if Microsoft has updated their own servers to recognize the ID that they've provided you is by repeatedly attempting to link your subscription until it succeeds.  I'd suggest trying about three times per business day until it works.  It does suggest contacting Microsoft support if can't log in, but only if you've waited three days or more.

+ Once you have successfully added your subscription, you're now allowed to download Visual Studio!  Go to the MSDN Downloads page (https://msdn.microsoft.com/en-us/subscriptions/downloads/) and select the latest version of Visual Studio Enterprise (2015 with Update 1, as of 03/11/2016).  Download and begin the installation process.

+ Once the installation process has completed, on the first run of the program, Visual Studio will ask you to log in to your account.  DON'T DO IT.  This sets up an entirely separate Visual Studio Team Services account that is unrelated to any of the previous steps.  Instead, chose "skip this step".  Once you've picked all of your other IDE preferences and Visual Studio opens up, you can close it again.

+ Go to the MSDN subscriptions "My Account" page (https://msdn.microsoft.com/en-us/subscriptions/manage/).  Under "Subscription Benefits", you will see "Visual Studio Team Services".  Link your VS Team services account to your work account by clicking "link my work account to Visual Studio Team Services".  As far as I can tell, if you don't link this together, Microsoft will refuse to recognize your MSDN subscription and cannot register Visual Studio to your MSDN license, despite the multiple steps and verifications that have already been performed.

+ Re-open Visual Studio.  Go to "File" -> "Account Settings".  Under "All Accounts", choose to add an account (namely, the Microsoft Account that you've created and linked to your organization using your work email address).  You will need to provide those login credentials to continue.  DO NOT SIGN INTO VISUAL STUDIO IN THE UPPER LEFT.  The login on the upper left is logging into VISUAL STUDIO TEAM SERVICES, the online project management tool and source control management tool, not the IDE.  If you do sign in, Microsoft will create a new Visual Studio Team Services account and link Visual Studio to that instead of anything relating to your MSDN account.

+ Once you have added your account into Visual Studio successfully, click "Check for an updated license".  If successful, your license should now say "License: MSDN Subscription".  You may notice that it also says "Unlock with a Product Key".  This option exists only to torment you.  Apparently, they stopped using Product Keys in Visual Studio 2013 and have moved exclusively to this method of registration, even for the free Visual Studio Community accounts.

+ You are now "officially sanctioned" in the eyes of Microsoft to begin coding.  Marvel at the process that has led you here.