我正在尝试在 Visual Studio 2013 中构建团队资源管理器的扩展。我在http://31og.com/post/getting-start-with-a-team-explorer-plugin-for-找到了博客vs-2013-part-3完成了添加导航项和页面的步骤,但是当我运行项目时,我看不到扩展。
输出中没有错误。我可以看到构造函数被调用,但没有添加到团队资源管理器中。
这是我们当前的代码:
namespace UoA.Cecil.VsTools.WindowPanes
{
using System;
using System.ComponentModel;
using System.ComponentModel.Composition;
using System.Drawing;
using System.Runtime.CompilerServices;
using Microsoft.TeamFoundation.Controls;
using Microsoft.VisualStudio.Shell;
[TeamExplorerNavigationItem(TeamExplorerGuids.TimesheetNavigationItem, 100)]
public class TimesheetTeamExplorerNavigationItem
: ITeamExplorerNavigationItem
{
private readonly IServiceProvider serviceProvider;
private bool isVisible;
[ImportingConstructor]
public TimesheetTeamExplorerNavigationItem([Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider)
{
this.serviceProvider = serviceProvider;
}
public event PropertyChangedEventHandler PropertyChanged;
public Image Image
{
get { return Resources.TimesheetImage; }
}
public bool IsVisible
{
get { return this.isVisible; }
private set
{
this.isVisible = value;
this.FirePropertyChanged();
}
}
public string Text
{
get { return "Timesheet"; }
}
public void Dispose()
{
}
public void Execute()
{
// Do something here
}
public T GetService<T>()
{
if (this.serviceProvider != null)
{
return (T)this.serviceProvider.GetService(typeof(T));
}
return default(T);
}
public void Invalidate()
{
}
private void FirePropertyChanged([CallerMemberName] string propertyName = null)
{
if (this.PropertyChanged != null)
{
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
}
关于为什么会发生这种情况的任何想法?