Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Created attachment 2043 [details]
#5151 changed the fast deployment model so that assemblies could be found implicitly, instead of requiring that every assembly to be deployed also be referenced by the App project.
The problem is that Mono.Android.Export.dll doesn't support this new model; if we have an App project which references a Library project, and the Library project references Mono.Android.Export.dll, the App fails to build.
monodroid email thread:
To reproduce, build the attached project.
Expected result: it builds.
Instead of the expected error, I'm rather got this one:
Isn't this due to different issue?
I'm not sure why you're getting that error. /verbosity:diagnostic output might be helpful.
I created the project by adding the Mono.Android.Export.dll assembly reference to the Application and Library projects, making sure it all built and ran, then just removing the Mono.Android.Export.dll assembly reference from the Application project.
Re-adding the Mono.Android.Export.dll assembly reference to the Application project _should_ allow it to build. (At least, it built when I first created the project...)
OK, that error *is* wrapping the missing export error as InnerException.
Now, I implemented decent assembly ref lookup, but noticed that there is another problem:
atsushi@atsushi-Aspire-3820:~/Desktop/Scratch.IndirectExport/Library/bin/Debug$ monodis --assemblyref Library.dll
0x00000000: C4 C4 23 75 47 E4 B6 CD
0x00000000: 7C EC 85 D7 BE A7 79 8E
There is somehow no reference to Mono.Android.Export.dll which makes it impossible to find the dll.
OK, this bug is invalid. No matter whether you add a reference to Mono.Android.Export.dll or not, the resulting assembly won't contain the reference because it is not in use at all (note that Java.Interop.ExportAttribute resides in Mono.Android.dll).
The only way you can add reference to Mono.Android.Export.dll is in the application, unless you explicitly use the types in this assembly.
I can still make changes to msbuild to look for indirect references, but it is meaningless, because none of the users can actually use the types in Mono.Android.Export.dll (there is no public type in it).
I suppose this is why I wanted Java.Interop.ExportAttribute to be in Mono.Android.Export.dll... ;-)
The same issue happened when I tried to build my app with the linking option "Sdk and User Assemblies". With the solution attached can reproduce what I'm talking about.
Please, can you help me to solve this? It's important in my application to use the mentioned option.
I have no idea what you meant by "the mentioned option" but you could (and need to) add Mono.Android.Export.dll to your application project.
I did. And it works fine until the linker option isn't set to "sdk and user assemblies" in project properties.
Please, DO NOT use "Link SDK and User assemblies."
Use "Link SDK Assemblies."
When I use "Link SDK Assemblies." my application stops without any exception. I thought it's because some of my own libraries couldn't be used without linking it... That's the cause of using "Link SDK and User assemblies."
Please file a separate bug about the application death without exception, and attach your project.
Unfortunately I can't. It's a huge project, and I develop it to a company so the source code is private. What's the problem with using "Link Sdk and User assemblies"? And why can't be solved the problem with this option and Export dll?