VS2005 Add-in: Solution Search

I finally got tired of having to hunt around for methods and properties in a large VS2005 solution and wrote an add-in to help out.   The add-in allows you to type in a portion of a class, method, or property name, and then navigate directly to that file.  In the case of a method or property, it also navigates you directly to that point in the code.  You can download the installer here and the source code here.  After you run the installer, load a solution in VS2005 and then press CTRL-Shift-N to pop up the search dialog. 

A few things I learned while writing this:

  • The documentation for EnvDTE and EnvDTE80 is pretty spotty and the API is buggy
  • Writing the add-in was 11,000 times more work than I would have expected
  • The code that is generated by the Visual Studio Add-in Wizard is BRITTLE
  • The command name used by Visual Studio to identify and trigger a plug-in consists of the fully-qualified class name of your “Connect“ (Connect.cs is the file/class name that is generated by the VS2005 Add-in Wizard) class, a “dot“, and then the action name.  The “connect“ class is the class that Visual Studio interrogates to register your add-in and also as a point of contact to determine which pieces of your add-in's functionality is available and ready to run.  In the case of my add-in, the “connect“ class is “Com.Benday.VisualStudio.SolutionSearch“ and the command is “ShowSearchDialog“.
  • The action name cannot contain any periods
  • The action name has a length limit but it's really long
  • If you're wondering why you keep seeing the OnConnection() method being called where the connect mode is ext_ConnectMode.ext_cm_UIStartup instead of ext_ConnectMode.ext_cm_UISetup, go check out HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\PreloadAddinStateManaged in the registry.  There's probably a value defined saying that your add-in has already been initialized.  Delete that value and restart.

-Ben

posted @ Sunday, March 19, 2006 6:47 PM

Print

Comments on this entry:

# re: VS2005 Add-in: Solution Search

Left by Jonny at 7/5/2006 6:41 PM
Gravatar
Hi Ben,

I am trying the addins in a large solutiion(about 80 projects).
and when I type in the search bar, it keeps showing me the error message.
PROJECT ITEM - (Unknown path)

I think I might missed some configurations.
Do you know what's the possible reason of this error?

Thanks!

# re: VS2005 Add-in: Solution Search

Left by John Hatton at 1/22/2007 10:52 PM
Gravatar
I installed this and it worked great. Then I got the code and (after removing each reference to a missing banner.bmp) was able to tweak it to my liking. Terrific. Thanks for sharing this Ben.

Your comment:



 (will not be displayed)


 
 
 
Please add 2 and 3 and type the answer here:
 

Live Comment Preview: