Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Regionerate on VS2012, or alternative addin

I tend to use Regionerate quite extensively for reorganizing my code files. My only problem is I can't get it registered with VS2012. I've abandoned VS2010 fully in favour of VS2012 and it's galling to have to flip back just to run a macro to reorganize code files. I've never tried writing a VS addin before so I'm not at all familiar with the object model or how to register - seems the old addins are more complicated to install than the VS2010 extensions! I've also looked through the WIX setup XML and tried replicating the registry keys to no avail.

Does anyone know how to either register Regionerate with VS2012, or is there an alternative (free and which is maintained!) extension that provides the same functionality?

like image 259
Richard Moss Avatar asked Aug 12 '12 10:08

Richard Moss


2 Answers

Two things needed for registration:

  • It looks like VS2012 doesn't read from the HKLM...\11.0\AutomationOptions key at runtime, only at first run. The corresponding key at HKCU...\11.0_Config\AutomationOptions needs to be set as well.
  • A new .AddIn file needs to be created with a Version of 11.0

If you do that, Regionerate will appear, but will hang Studio when you try to use it. The Regionerate code has a bad version check ("not equal" instead of "less than") that will get stuck in code that doesn't work for VS2010/2012. Unchecking "Automatically collapse regions" in Regionerate settings might be enough to avoid the bad code.

I made a new version that fixes the version check and has the correct install pieces for VS2012. You can download the installer and changed source files here:

https://skydrive.live.com/redir?resid=2FEB8D1988F04D77!565

like image 105
Frank Racis Avatar answered Nov 12 '22 09:11

Frank Racis


This is what you need to do to make VS2012 compatible Regionerate (0.8.0.1) by Frank Racis work with Visual Studio 2013.

  1. Modify this file: C:\Program Files (x86)\Regionerate\Regionerate.VS2012.AddIn Change version from 11 to 12: <Version>12.0</Version>

  2. Add the following string value in your registry:

    Location: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0_Config\AutomationOptions\LookInFolders

    Name: C:\Program Files (x86)\Regionerate\

like image 6
Moon Avatar answered Nov 12 '22 10:11

Moon