Visual Studio 2012/2013 Page Inspector fails with “Object reference not set to an instance of an object”


I’ve had this problem for as long as I can recall.  My page inspector in Visual Studio 2012 never worked… which normally would have been ok, since I could always do the old-school edit+save+refresh routine… but when you know that the feature exists, it is a bugger that it doesn’t work.

I tried everything, from disabling all my extensions and add-ons, to hooking up a debugger to my devenv process… to the obvious google-and-bing-fu manic searches… but got nothing.

If you check your ActivityLog.xml, you will see that Page Inspector is blowing up with a NullReferenceException… no surprise there.

After installing VS2013 I hoped that all of this would go away, but I got the same error.

Page Inspector fails with Object reference not found
Page Inspector fails with Object reference not found

Finally, I had the great brain wave of setting Internet Explorer as my default browser and restarting Visual Studio (I’m a chrome user).

…and voilà… page inspector finally works :(

One would think that by this time, this whole thing about being wired-in to Internet Explorer was a thing of the past… clearly it is not.

I’ve filed a bug report accordingly on Microsoft Connect.

DM2S63MFEY9G

Advertisements

SetSite failed for package [CctSharedPackage]


I’ve seen this exception way too many times in Visual Studio 11 and 12… turns out that it is an issue with Azure SDK 2.2 – and my google-fu skills failed to find a solution online.

Yet… if you look into your C:\Users\[username]\AppData\Roaming\Microsoft\VisualStudio\11.0\ActivityLog.xml file, you’ll find errors on the lines of:

Could not load file or assembly ‘Microsoft.VisualStudio.WindowsAzure.Diagnostics, Version=2.2.0.0…

The fix turns out to be quite simple, once you see that error.  This just means that the assembly cannot be found… so hey, just add it to your GAC like so:

Add assembly to GAC
Add assembly to GAC

Voila… problems solved.

 

“Windows Program Compatibility mode is on. Turn it off and then try Setup again.” – How to uninstall an app if this happens.


I tried uninstalling an application (in my case, I was uninstalling Visual Studio 2012 RC), and I kept getting this error.

Following the logs and the help file got me nowhere, and neither did searching all over the internet for instructions on how to uninstall this using a tool or the registry or whatever.

Disabling the program compatibility service also does not work.

It turns out that setup.exe was marked to run in Compatibility Mode, which is what was stopping me from uninstalling.

So my mission was now to find where the uninstall package actually is on my hard drive and to check what the compatibility settings are.

This is simple: (instructions are for uninstalling on Windows 8)

  1. Run the uninstaller until it fails
  2. Go to task manager
  3. Call up the context menu for the installer process (right-click)
  4. Select ‘open file location’
  5. This will open the package folder
  6. Call up the context menu for the uninstaller executable
  7. Select the ‘compatibility’ tab
  8. Disable all compatibility settings over here
  9. ~the end~

I hope this helps someone!

 

How to Uninstall ContinuousTests


For anyone who has played with Greg Young‘s amazing Visual Studio tool ContinuousTests, you may have discovered that uninstalling it tends to leave a ghosted menu option which seems impossible to remove.  I’m now on a mission to remove this!

Removing it turns out to be quite simple :)

  1. Right-click near your menu bar or speed buttons
  2. Select ‘Customize…’
  3. Select the ‘Commands’ tab
  4. In the list, select ‘ContinuousTests’
  5. Click ‘Delete’

All done :)

It turns out that as at the time of writing, the uninstaller removes all the menu items, but not the menu itself.

Making visual studio extensions work with vs 2011 developer preview


If you want to make your Visual Studio 2010 extensions work in Visual Studio 2011 Developer Preview, there is a little hack that you can do.

NOTE: Since this is a hack, there is NO guarantee that the extension will work properly.  But it might be worth giving a shot if, like me, the only thing stopping you from using VS 2011 is a few extensions that you just cannot live without :)

Also note that this only applies to vsix extensions.

1. Download the vsix file

To do this, go to the Visual Studio Gallery and search for your extension of choice.

Visual Studio Gallery
Visual Studio Gallery

Once you find you extension, download it to your desktop (or wherever)

Download Visual Studio Extension
Download Visual Studio Extension

(yes, that is one extension that I just cannot live without, it’s fantastic! Get it here)

2. Rename the file to zip

Once the file is downloaded, simply append .zip to the file name.

vsix renamed to zipAnd expand it into a folder using the default Windows ‘Extract All…’ option (right-click context menu) or whatever tool you want.

3.Edit the manifest

Next, in the expanded folder, edit the file extension.manifest using notepad, wordpad or whatever (I use Notepad++).

Look for the text ‘<VisualStudio Version‘, and change the value to read "11.0"

Change Visual Studio Version For ExtensionSave and close :)

4. Compress the folder content

Now, compress the folder content back into a zip file, using whatever tool you want.

In Windows, you can select all the content in the folder (CTRL+A), right-click, and select ‘send to’ and ‘compressed (zipped) folder’

Compress a folder to zip5. Rename the file back to vsix

Once compressed, rename the file back to .vsix

VSIX Visual Studio Extension6. Install it

Now all you need to do to install it is to Double-Click it.

Good luck :) It might not work, or it might partially work… but this system should allow you to install it.

Hope it helps :)  If anyone has any great extension suggestions, please let me know.