VersionControlExt.Explorer为NULL,如果我从解决方案资源管理器中调用,但是如果我从源代码管理资源管理器中调用,那么它将为我提供价值

问题描述 投票:0回答:1

我正在开发一个插件,用于查看解决方案资源管理器中单击按钮时设置的自定义更改。

我为此需要VersionControlServer引用,但是如果我从解决方案资源管理器中单击按钮,则无法获得该引用,但是如果单击源代码管理资源管理器中的按钮,那么它将起作用。但是我需要从解决方案资源管理器/团队资源管理器中调用它。

this.m_applicationObject = _applicationObject; this.versionControlExt = (VersionControlExt)this.m_applicationObject.GetObject("Microsoft.VisualStudio.TeamFoundation.VersionControl.VersionControlExt"); this.versionControlServer = this.versionControlExt.Explorer.Workspace.VersionControlServer;

c# visual-studio-extensions vsix
1个回答
0
投票

VersionControlExt.Explorer为NULL,如果我从解决方案资源管理器中调用但是,如果我从Source Control Explorer进行调用,那么它将给我带来价值

恐怕您无法通过使用VersionControlExt.Explorer得到想要的东西。

VersionControlExt.Explorer仅适用于Source Control Explorer,而不是Solution Explorer

[从this official document查看此:

enter image description here

Besides,不确定this comparison tool extension open source link是否可以为您提供帮助,我希望他们可以根据您的意愿来弥补。

© www.soinside.com 2019 - 2024. All rights reserved.