Bug 6131 - mdtool setup pack does not pick up the dependency assemblies
Summary: mdtool setup pack does not pick up the dependency assemblies
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: Trunk
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Lluis Sanchez
Depends on:
Reported: 2012-07-15 21:21 UTC by Atsushi Eno
Modified: 2012-07-21 05:10 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Atsushi Eno 2012-07-15 21:21:23 UTC
I built a MD addin that depends on some external assembly, like MonoDevelop.VersionControl.Git.dll depends on NGit.dll.

Now, I tried to create a .mpack package using "mdtool setup pack" command. It resulted in an archive that does not contain the dependencies.

repro assemblies:
- https://dl.dropbox.com/u/493047/2012/07/MonoDevelop.VersionControl.Mercurial.dll (the addin)
- https://dl.dropbox.com/u/493047/2012/07/Mercurial.Net.dll (dep)

In case you want to build those assemblies, the sources are in my MD fork:
- https://github.com/atsushieno/monodevelop/tree/mercurial

With bug #3700 (mdtool gsetup never works), there is not really a way to build a working mpack at all.
Comment 1 Mikayla Hutchinson [MSFT] 2012-07-16 10:15:08 UTC
Mono.Addins has no way to know whether you are supplying the dll or expecting it to come from some other addin or from the GAC. You must declare the dependency in the <Runtime> element:

<Import assembly="Mercurial.Net.dll "/>

Note you don't need to explicitly Import on MonoDevelop.VersionControl.Mercurial.dll, it's implicitly imported if the addin manifest is embedded into it.
Comment 2 Atsushi Eno 2012-07-17 00:44:08 UTC
I don't think that works or in the way we (addin devs) expect. I replaced the <Runtime> element and now it looks like:
		<Import assembly="Mercurial.Net.dll" />

Then I rebuilt it (to have it bundled in my addin dll), and went to main/build/AddIns/VersionControl, and ran "mdtool setup pack MonoDevelop.VersionControl.Mercurial.dll" . The resulting .mpack still does not contain Mercurial.Net.dll.

Or if you meant that the mpack won't contain any dependencies because Mono.Addins has no way to know the origin of the assembly, how can I distribute the addin that *actually* works, with incomplete dependencies?
Comment 3 Mikayla Hutchinson [MSFT] 2012-07-17 11:58:32 UTC
That should work, are you sure the resource got picked up? Try rebuilding.
Comment 4 Atsushi Eno 2012-07-21 05:10:35 UTC
Somehow I needed some updates to the build and now it worked! Thanks.