English 中文(简体)
2008年至2010年
原标题:VS plugin from 2008 to 2010

I have a plug-in that I use with Visual Studio 2008. I am testing 2010 and one of the problems I am seeing is the fact that the plug-in doesn t get loaded anymore.
This is the command I am using to add my plug-in:

toolsMenuName = "Tools"; 

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


CommandBarControl toolsControl = menuBarCommandBar.Controls[toolsMenuName];
var toolsPopup = (CommandBarPopup)toolsControl;


try
{

Command command = commands.AddNamedCommand2(_addInInstance, "TestData", "Test Data", "", true, 0, ref contextGUIDS, (int)vsCommandStatus.vsCommandStatusSupported + (int)vsCommandStatus.vsCommandStatusEnabled, (int)vsCommandStyle.vsCommandStylePictAndText, vsCommandControlType.vsCommandControlTypeButton);


if ((command != null) && (toolsPopup != null))
{
command.AddControl(toolsPopup.CommandBar, 1);
}
}
catch (ArgumentException)
{

}

2010年VS发生了什么变化?

Thanks Tony

最佳回答

我在2005年和2008年做了另外的工作(从0.net 2.0),我不得不做no change,以便在2010年开展工作。 因此,从根本上来说,2010年的工作是2.net+-incan(尽管你可能需要打上几条事情才能使其完美运作,但装货和增加指挥带的基本面已发生变化)

这表明,这或许是一种简单的 gl光——我怀疑:

  • There is something wrong in your .Addin file, or it is not on the VS2010 add-ins path, so it is not being loaded by VS2010, or
  • The add-in is loading, but is not adding its commands successfully.

因此,我建议的第一件事是检查它是否装载了ok。 Go to Tool->Add-In Manager, see if it is listed andecked. 否则,它要么不走上附加的道路,要么是你的MyAddin。 Addin file isn tect (has the XML has been updated to Target edition 10.0 of the IDE or is it still statements edition 9.0?)

如果它装上了ok,那么你就必须把它放在一个gger子下,看看为什么你的指挥是正确的。

问题回答

很多情况已经改变,但主要是cl变,从3.5使用cl2.0。 净额4.0使用新包裹,因此,机会是pri子

关于





相关问题
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. ...

热门标签