0

I'm developing simple VS 2008 addin.
Now I have only autogenerated code of base autogenerated files.
This is "TestsGenerator - For Testing.AddIn" file:

<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<Extensibility xmlns="http://schemas.microsoft.com/AutomationExtensibility">
    <HostApplication>
        <Name>Microsoft Visual Studio Macros</Name>
        <Version>9.0</Version>
    </HostApplication>
    <HostApplication>
        <Name>Microsoft Visual Studio</Name>
        <Version>9.0</Version>
    </HostApplication>
    <Addin>
        <FriendlyName>CSUnit tests generator</FriendlyName>
        <Description>Generates tests for csUnit basing on TestingTable.xml file</Description>
        <Assembly>D:\Nova\dev\RecipeConverter\Sources\TestsGenerator\bin\TestsGenerator.dll</Assembly>
        <FullClassName>TestsGenerator.Connect</FullClassName>
        <LoadBehavior>0</LoadBehavior>
        <CommandPreload>1</CommandPreload>
        <CommandLineSafe>0</CommandLineSafe>
    </Addin>
</Extensibility>

I succeed to debug the code, when I run the project in F5. Now, here is list of functions calls after I press F5:

constructor()
OnConnect()

I press on Addin's button in Tools menu:

OnConnect()
Exec()

AND!!! The button desapears from the Tools menu!!!
Can some one tell me WHY it happens!?
Thank you for ahead.

rodnower
  • 1,365
  • 3
  • 22
  • 30

1 Answers1

0

OK, for the truth not all files were autogenerated, I get part of them from another add-in.
Any way. While full name of add-in Connect class was: TestsGenerator.Connect the QueryStatus function looked like:

public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText)
{
    if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
    {
        if (commandName == "MyAddin2.Connect.MyAddin2")
        {
            status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
            return;
        }
    }
}

After I changed condition following all started working:

if (commandName == "TestsGenerator.Connect.MyAddin2")
rodnower
  • 1,365
  • 3
  • 22
  • 30