VSIX Package doesn't include referenced project's dependencies
Asked Answered
D

2

6

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.

Deanedeaner answered 24/8, 2012 at 13:15 Comment(2)
I wasn't able to repro this. Are you sure that there is a source-level dependency from VSPackage -> ProjectA and ProjectA -> ProjectB (i.e. a type in ProjectA uses a type from ProjectB)?Hepsiba
@AaronMarten Thanks for the reply.. Yes there is a source level dependency in the code. Removing either of the project references causes plenty of build errors where the referenced classes can no longer be found. I have created a simple solution that exhibits the problem for me, it can be downloaded HEREDeanedeaner
H
2

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.

Hepsiba answered 28/8, 2012 at 18:10 Comment(1)
Yes this is the obvious solution and is what I have done to get this working in the short term. However, I would like to get to the bottom of this and understand why it is not working as it should. Did you test with the example solution that I uploaded?Deanedeaner
F
1

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)

Flatboat answered 17/6, 2014 at 7:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.