问题
Im working on a couple of independent Visual Studio extensions in separate solutions. When I open one of them and launch the experimental instance in the debugger, the other extensions from the other solutions (which aren't open) are loaded as well. There must be a way to only launch one extension in the experimental instance at a time (in particular the one you're currently working on), right?
回答1:
Not really. When you build and run the extension project in VS, it is actually deployed to the experimental instance of VS, but they're not uninstalled when you finish debugging/running.
Your best bet is to use the script to reset the experiment instance that is provided with the VS SDK. Unfortunately you'll have to do this every time you switch between your solutions.
Look in the start menu for:
Microsoft Visual Studio 2010 SDK\Tools\Reset the Microsoft Visual Studio 2010 Experimental instance.lnk
回答2:
You can actually create as many experimental instances as you like by using different, arbitrary values of the "RootSuffix" parameter (which will create multiple separate base keys in the registry) but I'm not sure how easy it is to configure VSSDK projects (such as VsPackage ones) to publish to a different VS hive. Probably just a property you set inside each project file. Each experimental instance is completely separate.
So you can run "devenv.exe /RootSuffix MyFirstInstance" and "devenv.exe /RootSuffix MySecondInstance" and each will use separate sets of user extensions. This would result in using the registry keys HKCU\Software\Microsoft\VisualStudio\10.0MyFirstInstance_Config and HKCU\Software\Microsoft\VisualStudio\10.0MySecondInstance_Config, respectively.
They seem to have removed a lot of the documentation for this feature since VS2005, but it all still seems to work.
来源:https://stackoverflow.com/questions/7294995/developing-multiple-visual-studio-2010-extensions