简体   繁体   中英

VSIX Package doesn't include referenced project's dependencies

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).

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.

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?

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?

Thanks for looking.

在这种特殊情况下最简单的方法是从VSPackage项目引用Project B并将“Reference Output Assembly”属性设置为False以避免引入编译时依赖项。

I had a similar problem: My VS Package project referenced another VS package project (~ Project A ) which in turn referenced a bunch of other projects (~ Project B ) containing the meat of our extension.

Inspired by this answer: VSIX package doesn't include localized resources of referenced assembly , I added ' BuiltProjectOutputGroup;BuiltProjectOutputGroupDependencies;GetCopyToOutputDirectoryItems;SatelliteDllsProjectOutputGroup ' to the Output Groups Included in VSIX property of the reference from VS Package to Project A .

This had the effect of dropping all the dependency DLLs in the ...\\Debug\\ folder for my VS Project , but they still didn't get included in the VSIX.

Finally I went and added the BuiltProjectOutputGroup;BuiltProjectOutputGroupDependencies;GetCopyToOutputDirectoryItems;SatelliteDllsProjectOutputGroup flags to all the references from my Project A to each of my Project Bs - then they all got included in the VSIX.

(BTW this is with with Visual Studio 2013, but it doesn't seem to have change much since 2010)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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