我已经创建了非常简单的Visual Studio插件,由JP Booodhoo编写的这篇文章。Visual Studio插件没有显示
http://codebetter.com/jpboodhoo/2007/09/04/macro-to-aid-bdd-test-naming-style/
的插件工作在调试,所以如果我F5在加入溶液,并打开一个解决方案,则插件显示的工具。但是,它不显示何时不调试。即在我部署了插件之后,关闭并重新打开了我的解决方案。
我错过了什么吗?
在部署方面,我也跟着本文中的部署步骤,并将其部署到C:\用户[用户名] \文档\的Visual Studio 2012中\加载项
Alternative to macros in Visual Studio 2012
public void Exec(string commandName, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
{
handled = false;
if(executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault)
{
if(commandName == "KinghamExtensions.Connect.KinghamExtensions")
{
var selection = (TextSelection)(_applicationObject.ActiveDocument.Selection);
selection.SelectLine();
if (selection.Text == "") return;
var prefix = "public void ";
var index = selection.Text.IndexOf(prefix);
prefix = selection.Text.Substring(0, index) + prefix;
var description = selection.Text.Replace(prefix, String.Empty);
selection.Text = prefix + description.Replace(" ", "_").Replace("'", "_");
selection.LineDown();
selection.EndOfLine();
handled = true;
}
}
}
正如我所说,代码在vs中运行插件时会起作用,但不会显示在工具菜单中。
另外,它不会显示在键盘选项中,例如Git Extensions插件的含义,我无法指定键绑定。
有什么想法?