English 中文(简体)
视觉2008年演播室 Addin Disapear在首次点击之后
原标题:Visual Studio 2008 Addin disapears after first click

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:NovadevRecipeConverterSourcesTestsGeneratorinTestsGenerator.dll</Assembly>
        <FullClassName>TestsGenerator.Connect</FullClassName>
        <LoadBehavior>0</LoadBehavior>
        <CommandPreload>1</CommandPreload>
        <CommandLineSafe>0</CommandLineSafe>
    </Addin>
</Extensibility>

在我用F5管理该项目时,我成功地推翻了该守则。 现在,在我发布第5号新闻稿后,这里是要求履行的职能清单:

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.

最佳回答

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;
        }
    }
}

在开始工作之后,我改变了条件:

if (commandName == "TestsGenerator.Connect.MyAddin2")
问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签