Visual Studio 2010 Beta 1 Compilation and Installation Issues

Jul 15, 2009 at 4:37 AM


C:\Program Files (x86)\Microsoft Visual Studio 2010 Beta1 SDK\VisualStudioIntegration\Tools\Bin>CreatePkgDef D:\projects
\pubsvn\trunk\WSPTools\App\WSPBuilderTemplates\bin\debug\WSPBuilderTemplates.dll /assembly /out=Test
Visual Studio (R) PkgDef Creation Utility.
Copyright (c) Microsoft Corporation. All rights reserved.

Assembly: WSPBuilderTemplates
Output file: Test.pkgdef

CreatePkgDef : error : No Visual Studio registration attribute found in this assembly.
The assembly should contain an instance of the attribute 'Microsoft.VisualStudio.Shell.RegistrationAttribute' defined in
 assembly 'Microsoft.VisualStudio.Shell.Immutable.10.0' version ''

I tried lots of variations of the different Shell extensions but just couldn't get past this.


I went with the manual installation and found that CommandBar is still in flux.  I removed all references to command bar but the right click context menu would not show up.  It would be great to get it working with the right click context menu in VS 2010.  Although, the forthcoming visual studio sharepoint development tools may render this a bit obsolete :P

Jul 15, 2009 at 6:09 PM

Ok.  Progress.  For anyone looking to use WSPBuilder with Visual Studio 2010, you will have to remove and comment out all references to command bar (takes maybe 5 minutes).  You will notice the code references by simply removing the commandbar dll reference from the Addin project.  Remove any method parameters that contain command bar and only comment out the parts that utilize command bar.  The rest is needed for registering the commands themselves.  Manually install the addin.    Once the addin is installed, you can access the functions using the shortcut keys.  Look in Tools>Options under Keyboard and filter by WSP.  That's your list of commands.

The keyboard combination CTRL+SHIFT+B, B is wsp build etc...

PHeewww... can't wait for 2010 SP so these headaches are gone.

Dec 7, 2010 at 2:07 PM
Edited Dec 8, 2010 at 9:31 AM

I'm working with VS 2010 final.

Well, there is another way to get the add-in working with VS 2010. The Addin try to get the command bars according to their GUID. It seems to work for previous version of VS but fails for "tools" menu in VS 2010.

The work around i've found is the following :

In the WSPools.VisualStudio.VSAddin.VSMenuHandler class, go to the "GetCommandBar" method with following signature : Public CommandBar GetCommandBar(MenuItemDefinition menuDefinition)

There are two nested try/cach blocks. In the second one, replace the try block code by the following one :

                     CommandBar menuBarCommandBar = ((Microsoft.VisualStudio.CommandBars.CommandBars)ApplicationObject.CommandBars)["MenuBar"];

                    //Find the command bar on the MenuBar command bar:
                    CommandBarControl cbc = menuBarCommandBar.Controls[menuDefinition.Name];
                    CommandBarPopup cbp = (CommandBarPopup)cbc;

                    bar = cbp.CommandBar;