Bug 37611 - Assembly not copied into .app when only referenced by assembly-level custom attribute
Summary: Assembly not copied into .app when only referenced by assembly-level custom a...
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: XI 9.8 (tvOS / C7)
Hardware: PC Mac OS
: Normal normal
Target Milestone: (C7)
Assignee: Sebastien Pouliot
Depends on:
Reported: 2016-01-12 13:00 UTC by Martin Baulig
Modified: 2016-06-02 16:45 UTC (History)
3 users (show)

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

Test case (13.70 KB, application/zip)
2016-01-12 13:02 UTC, Martin Baulig

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 Martin Baulig 2016-01-12 13:00:55 UTC
When an assembly is only referenced by an assembly-level custom attribute - such as

    [assembly: MyAttribute (typeof (MyTest))]

that assembly is not copied into the .app even when linking is disabled.
Comment 1 Martin Baulig 2016-01-12 13:02:09 UTC
Created attachment 14552 [details]
Test case
Comment 3 Sebastien Pouliot 2016-01-12 13:07:43 UTC
> [assembly: Preserve (typeof (MyTest))]

^ works for the linker (even if it's not enabled in your test case).

Now custom attributes do not encode type references (nor assembly references) in assemblies (only in the CA metadata). So I guess that's the problem you're hitting.

note: mtouch walks all assemblies references to find what assemblies are required to be copied into the .app.
Comment 4 Sebastien Pouliot 2016-01-14 18:30:45 UTC
Fixed in maccore/master 352e32ba786e13dce8d391b5d9ac4afb433f858a