AddNamedCommand fails in 2005 beta 2

We have an Add-In that works in VS.NET 2002, 2003 and 2005 Beta 1. It uses Commands.AddNamedCommand to add custom commands. The satellitedllpath and satellitedllname registry entries for the Add-In point to the satellite resource dll, stored in a 1033 directory, containing the custom bitmaps we are using for the command images.

When the Add-In loads in VS.NET 2005 beta 2, a 'Value does not fall within the expected range' error fires on the call to AddNamedCommand. We have tried all sorts of things to try and isolate the problem, including creating managed satellite assemblies, trying the AddNamedCommand2 method instead with a "@1" bitmapid parameter (as outlined in a MSDN feedback center article). The best result we can get is to get the command created, but without our custom bitmap (a blank button).

Using filemon I can tell that the resource dll is being correctly found and loaded (using AddNamedCommand2) but the bitmap isn't being used on the button.

Have there been changes in beta 2 affecting how the resources are loaded from the resource .dll, or resource .dll requirements, that might be responsible for the original AddNamedCommand error Is there an example available detailing how to use AddNamedCommand2 to specify a custom bitmap

I've tried absolutely everything I can think of and am now at a dead end - I would really appreciate any advice or insight anyone might be able to offer.

Richard Sloggett
Innovasys


Answer this question

AddNamedCommand fails in 2005 beta 2

  • Holy-Fire

    This makes it impossible to test our product on Visual Studio 2005. Will there be a Beta 3, or do we wait till a RC When might that be

  • Albert Raiani

    After hours of trying to figure out why the default solution of a new Add-In project works, but my own code doesn't. Here's what it boils down to, and it seems to make sense how a programmer could've made this bug in the Visual Studio Code.

    It appears that the Name, and Text parameters must match to make this work in Visual Studio .NET 2005 Beta 2.

    The function also fails if you use special characters or whitespace.

    Don't worry, you can change the label of the controls during the IDTCommandTarget.QueryStatus method, by changing the ref param CommandText.

    Cheers!



  • Joachim Welsch

    I have the same problem with a simple addins with C++/ATL with the final release of VS.Net professionnal.
    On VS.Net 2003, my bitmap was correctly load and display.

    But with VS.Net 2005 my bitmaps can't be loaded. Function "AddNamedCommand" return FAIL.
    My file "AddIn.rgs" had been updated and the Satellite DLL PathName was present in the registry.

    Is it an issue
    Is someone has a simple sample of addins with bitmap on VS 2005

    best regards,
    Francois.

  • Mr. Underhill

    I am trying this with the new VS RTM from MSDN.  I still get an error when our add-in calls AddNamedCommand.

    Our addin (built in VS 2003) runs fine in 2003.

    Has this known issue been resolved   Is there any info about this -- online etc

  • iljforever

    Hi Richard,
       Unfortunately, this is a known bug in Visual Studio 2005 Beta 2. Since Beta 2 shipped, we have fixed the problem you're referring to and slightly changed the way that custom command bitmaps are loaded for addins. More details will be available as we move closer to the final release of VS 2005.
       Thanks for letting us know about this problem.

    Sincerely,
       Aaron Marten [MSFT]

  • AddNamedCommand fails in 2005 beta 2