VSIX 包不包含引用项目的依赖项 [英] VSIX Package doesn't include referenced project's dependencies

查看:45
本文介绍了VSIX 包不包含引用项目的依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个 Visual Studio 包(VS 包),它引用了一个类库项目(项目 A).项目 A 依次引用另一个类库项目(项目 B).

We have a visual studio package (VS Package) that references a class library project (Project A). Project A in turn references another class library project (Project B).

所以依赖结构是这样的:VS Package > Project A > Project B

So the dependency structure looks like this: VS Package > Project A > Project B

所有项目都存在于同一个解决方案中,并且依赖项已设置为正确的项目引用.

All projects exist inside the same solution and the dependencies have been set up as proper project references.

如果我在 Visual Studio 中构建包并在 bin/Debug 文件夹中查看所有必需的程序集,包括项目 B 的程序集.但是,在部署包时,仅存在项目 A 的程序集,而缺少项目 B 的程序集.我如何告诉 Visual Studio 在包中包含项目 B 的间接依赖?

If I build the package in visual studio and look in the bin/Debug folder all necessary assemblies are there including Project B's. However when the package is deployed, only Project A's assemblies are present and Project B's are missing. How do I tell visual studio to include the indirect dependency of Project B in the package?

此 MSDN 文档建议默认情况下,在多项目解决方案中,如果输出到 VSIX 包的项目包含对同一解决方案中另一个项目的引用,则它包含该项目的依赖项."

This MSDN document suggests that "By default in a multi-project solution, if a project that outputs to a VSIX package includes a reference to another project in the same solution, it includes the dependencies of that project."

然而我发现事实并非如此.

However I am finding that this is simply not the case.

我的问题与这个问题非常相似 除了我遇到了主项目程序集而不是本地化附属程序集的问题.另一篇文章中的答案对我不起作用,因为它似乎只适用于附属程序集.

My question is very similar to this one except that I am having trouble with the main project assembly and not the localization satellite assemblies. The answer in this other post does not work for me because it seems to only work for satellite assemblies.

我是否可以指定其他一些输出组来指示包也包含间接依赖项?

Is there some other Output Group that I can specify to direct the package to include indirect dependencies as well?

感谢您的关注.

推荐答案

在这种特殊情况下,最简单的做法是从 VSPackage 项目中引用项目 B,并将引用输出程序集"属性设置为 False 以避免引入编译-时间依赖.

The simplest thing to do in this particular case is reference Project B from the VSPackage project and set the "Reference Output Assembly" property to False to avoid introducing a compile-time dependency.

这篇关于VSIX 包不包含引用项目的依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆