VSIX Package doesn't include referenced projec

2020-02-29 02:37发布

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.

2条回答
兄弟一词,经得起流年.
2楼-- · 2020-02-29 02:48

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)

查看更多
甜甜的少女心
3楼-- · 2020-02-29 03:01

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.

查看更多
登录 后发表回答