简体   繁体   English

自定义项目类型中缺少“参考管理器”(在 VS 隔离外壳中)

[英]"Reference manager" missing in custom project type (in VS IsolatedShell)

I'm working on a VS IsolatedShell 2015 application;我正在开发一个 VS IsolatedShell 2015 应用程序; my current goal is to enable project references.我目前的目标是启用项目引用。
However when right-clicking the 'references' node in a project there are basically no options available, most notably for my case the reference manager is missing:但是,当右键单击项目中的“引用”节点时,基本上没有可用的选项,尤其是在我的情况下,缺少引用管理器:

“参考”节点的上下文菜单

The project itself is based on CPS, so maybe I need to enable this somewhere in there?该项目本身是基于 CPS,所以也许我需要在那里的某个地方启用它?

The project does contain these capabilities (as documented here ):该项目确实包含这些功能(如此处所述):
<ProjectCapability Include="AssemblyReferences;COMReferences;ProjectReferences;SDKReferences" />

I've also added the ReferenceManagerProjects & DependenciesTree capabilities ( another link ) and made sure that there are rule files for the resolved references (I tested this by manually adding some assembly references to the project and those are displayed correctly).我还添加了ReferenceManagerProjects & DependenciesTree功能(另一个链接),并确保存在已解析引用的规则文件(我通过手动向项目添加一些程序集引用来测试这一点,并且这些引用正确显示)。

Within the Shell.pkgundef file the 'web specific packages' are enabled, as hinted in the last answer on this page .在 Shell.pkgundef 文件中,启用了“特定于网络的软件包”,如本页最后一个答案中所暗示的那样。
I've also looked through all other pkgdef/pkgundef files, but nothing else looked like it should be responsible for the reference manager.我还查看了所有其他 pkgdef/pkgundef 文件,但没有其他文件看起来应该由参考管理器负责。

Are there any other places that could lock the reference manager out?还有其他地方可以锁定参考管理器吗?
Or is there some interface that has to be implemented for CPS to enable this?或者是否需要为 CPS 实现一些接口才能启用此功能?

Turned out one solution to the problem was adding an implementation of the IProjectCapabilitiesProvider and return the capabilites for the reference types I needed there:原来解决问题的一种方法是添加IProjectCapabilitiesProvider的实现并返回我需要的引用类型的功能:

 public Task<IEnumerable<string>> GetCapabilitiesAsync()
 {
     return Task.FromResult<IEnumerable<string>>(new[]
     {
         CustomProjUnconfiguredProject.UniqueCapability,
         "AssemblyReferences",
         "ProjectReferences"
     });
 }

The reference manager can still not be accessed using the 'references' node, however using the context menu on a project you can find it in 'Add' > 'Reference'仍然无法使用“参考”节点访问参考管理器,但是使用项目上的上下文菜单,您可以在“添加”>“参考”中找到它

参考管理器的备用位置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM