"'a' stands for headache" by Eduardo Ortiz

After launching an Azure project in Visual Studio 2013, I was handed a “The ‘CctSharedPackage’ package did not load correctly.” error message.

The 'CctSharedPackage' package did not load correctly.

I was unfamiliar with that one, and a quick check of the forums showed that a few people had reported this happening after installing the latest Windows 8.1 update. An update that I had installed two nights ago.

If you check the Visual Studio activity log in %APPDATA%\Microsoft\VisualStudio\12.0\ActivityLog.xml, you’ll see something like this

<entry>
  <record>1638</record>
  <time>2014/04/14 02:36:02.772</time>
  <type>Information</type>
  <source>VisualStudio</source>
  <description>Begin package load [CctSharedPackage]  </description>
  <guid>{77A5A151-6A9B-4D08-BC38-340AB29566E2}</guid>
</entry>
<entry>
  <record>1639</record>
  <time>2014/04/14 02:36:02.773</time>
  <type>Error</type>
  <source>VisualStudio</source>
  <description>SetSite failed for package [CctSharedPackage]  </description>
  <guid>{77A5A151-6A9B-4D08-BC38-340AB29566E2}</guid>
  <hr>80070002</hr>
  <errorinfo>Could not load file or assembly 'Microsoft.VisualStudio.WindowsAzure.Diagnostics, Version=2.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.</errorinfo>
</entry>

Something in the Windows 8.1 April Update blew out at least one assembly that Visual Studio needed. This has an easy work around. Shut down any instances of Visual Studio that you may have running. Go to “Programs and Features” in the “Control Panel” and look for an item that starts with “Windows Azure Tools for Visual Studio 2013”.

Double-click that item to bring up the modify setup dialog. On that dialog select “Repair”.

Azure Tools Modify Setup dialog

That will churn for a minute or two. After that completes, you should be back in business. If you are using the Azure Tools with other versions of Visual Studio, you may may to repair them as well.

An alternative means of fixing this is by re-installing the missing assembly into the GAC as described on Stefan Camilleri’s [blog](http://edd.stefancamilleri.com/2013/12/12/setsite-failed-for-package-cctsharedpackage/ “SetSite failed for package [CctSharedPackage] edd - Exception Driven Development”).
<code>C:\Program Files (x86)\Windows Azure Tools\Visual Studio 11.0>gacutil /i .\Microsoft.VisualStudio.WindowsAzure.Diagnostics.dll</code>

I chose the self repair option of the Azure Tools installer, because I had no idea if anything else was broken.  That’s the why Windows Installer technology has the repair option.  It will fix the stuff under the hood that you can’t easily see.

Once I got that straightened out, I checked to see if there was a later version. I was at v2.2 and v2.3 was released during //Build. So I grabbed that and installed. I probably could have just upgraded straight from 2.2 to 2.3 without repairing the v2.3, but I did this way with out any problems.

*The “a” is for headache image is from Eduardo Ortiz’s collection on Flickr