Update: Visual Studio 2010 is now officially supported. There is no need to use this workaround.
I really hoped to get Regionerate running quickly on Visual Studio 2010 Beta 2.
Unfortunately, since there are several breaking changes with Visual Studio 2010’s extensibility model, I found myself messing around with it too much.
I’m not giving up, but I just need to clear an afternoon for it. Meanwhile, Since I’ve been getting a whole bunch of requests for quick support for 2010, here’s a quick workaround:
- Go to “%programfiles%\Regionerate”.
- Make a copy of “Regionerate.VS2005.AddIn” and call it “Regionerate.VS2010.AddIn“.
- Open it with notepad, change Extensibility/HostApplication/Version to 10.0 and save the file.
- Open up regedit.exe.
- Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Visual Studio\10.0\AutomationOptions\LookInFolders.
- Add a string key named “C:\Program Files\Regionerate\” (or wherever you had Regionerate installed)
- Start Visual Studio 2010 and go to Tools/Regionerate Settings.
- Turn off Automatically collapse regions after Regionerating. (Yes, they won’t collapse until I fix it)
Update: Thanks for Mr. Bungle for reminding me to add step 4-6. Mike Patton enthusiasts FTW!
Add your comments here if you have any problems using this workaround.
Thanks for this info, seems I am missing something tho – I don’t see a Tools->Regionerate Settings menu after launching VS2010. Do I need to copy or register the .addin file somewhere?
Posted by Mr. Bungle on November 25th, 2009 12:02 am
IIdiot. Updated the post. Hope it would work now.
Posted by rauchy on November 25th, 2009 7:19 am
Adding that registry key does mean I have a Tools->Regionerate menu in VS 2010, however I get two exception errors on startup of VS relating to Regionerate. One is a DeprecatedException and the other is an ArgumentException (A command with that name already exists). I can email u screenshots of the exceptions if you want. Going into the Settings dialog for Regionerate works ok, but trying to regionerate a source file using Ctrl+R ends up putting VS into an endless loop, requiring it to be killed. I will stick with using the command line for now, passing the .sln file (so glad you have ability to do this outside the IDE
).
Posted by Mr. Bungle on November 30th, 2009 1:18 am
It might be worth noting that for those of you who have 64bit platforms, you probably won’t find the registry key mentioned because when you run regedit, it will give you the registry for your 64bit applications. Visual studio is still a 32bit application, so you’ll need the 32bit registry editor.
To start 32bit regedit:
%systemroot%\syswow64\regedit
The default install location (ie, the key you will need to create) is:
%ProgramFiles(x86)%\Regionerate
After doing this, you will get a regionerate error message box when you first start up about deprecated methods. There isn’t much you can do here as there is just an ok button.
Unfortunately, this message may have been more significant than I first though because after regionerating my first file, Visual Studio spiraled into unresponsive death.
If anyone finds a way to get it to work on 64bit platforms, send an update.
Posted by Pondy on December 15th, 2009 8:19 am
Answer to my own problem:
De-select the option “Automatically collapse regions after Regionerate”.
Posted by Pondy on December 15th, 2009 8:28 am
Thanks for this, after following the instructions I am back up and running.
Its worth noting though, that to trigger regionerate you cannot use the pop-up right-click context menu. This doesn’t seem to work for me. However I can still configure and use a short-cut key (Ctrl+R by default) and this formats to the default style.
Cheers
Ben
Posted by Ben on January 12th, 2010 2:25 am