Bug 4030 - MonoDevelop does not respect "copy local" on package references
Summary: MonoDevelop does not respect "copy local" on package references
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Project Model ()
Version: Trunk
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Lluis Sanchez
Depends on:
Reported: 2012-03-22 11:28 UTC by Alan McGovern
Modified: 2017-08-22 21:46 UTC (History)
9 users (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 Alan McGovern 2012-03-22 11:28:29 UTC
1) Create a project
2) Add MonoMac (provided by monodevelop) as a reference
3) Ensure "Local Copy" is enabled
4) Build the project

Result: MonoMac.dll is not copied locally.
Comment 1 Mikayla Hutchinson [MSFT] 2012-03-22 12:36:40 UTC
This is specific to MD's "package" references. For some reason, MD assumes that all assemblies from "packages" are GAC assemblies and should not be copied locally. Whereas VS/MSBuild, when copying assemblies from assembly folders (analogous to MD's packages), actually checks whether the assemblies are in the GAC. That isn't ideal either, since it means that the build behaviour depends on the GAC, but at least it's more likely to do what the user desires.

MD's behaviour doesn't usually cause problems because most package assemblies are in the GAC, however, note that the MonoMac addin and ASP.NET MVC project type addins have to specifically work around this behaviour in a couple of cases:

Probably the best solution is to mimic VS. We might get this automatically when we move to xbuild...
Comment 2 Jo Shields 2012-06-15 16:15:24 UTC
So apparently this is a big problem for me too. I'm trying to fix up the MonoGame templates so they actually work, and they don't - because MD refuses to copy the non-GAC MonoGame.Framework.Linux assembly to the output folder. Build works, run fails. Clusterfuck.

Non-GAC assemblies are not uncommon, and it's not unreasonable to expect them to be used by users. Something like Cecil, for example, breaks ABI all the time. Telling developers "do a file reference instead, it's just as good" is incredibly user hostile.

For now I'll look at stealing that MonoMac hack - but it's a hack, and MonoDevelop should do better.
Comment 3 Stephen Shaw 2012-06-30 15:29:39 UTC
I just tried this in f-spot using xbuild and it appears to be broken in xbuild as well.
Comment 4 Marcos Cobeña Morián 2013-09-25 06:38:27 UTC
Updating our templates (Wave Engine) from MonoDevelop 3 to Xamarin Studio we've also encountered the same issue, could you please let us know any estimation or similar about when this could be worked out?

Thanks in advance!
Comment 5 Mikayla Hutchinson [MSFT] 2013-09-25 18:05:07 UTC
No ETA on fixing this, sorry.
Comment 6 Marcos Cobeña Morián 2013-09-26 02:19:23 UTC
OK, no problem, we'are also working with the workaround.

Thanks Michael.
Comment 7 Will Smith 2017-08-22 21:46:43 UTC
Thanks so much for taking the time to submit this report! I attempted to reproduce this issue based on the bug description with the latest Visual Studio 2017 for Mac Preview version 7.2, and I was unable to hit the problem. If this issue is still occurring for you, please reopen this report and attach a reproduction, ideally starting with a new template project and then adding just the code necessary to demonstrate the issue.