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 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.
Many commercial entities will want to have their assemblies show up in the Visual Studio Add Assembly Reference dialog in Mono for Android projects. For "normal" .NET, this is supported via registry keys; see:
Unfortunately, the registry keys listed in the above article and the "obvious" alternatives are not used in Mono for Android + VS projects, e.g.:
This despite verbose MSBuild output mentioning that the AssemblySearchPaths contains:
> AssemblySearchPaths =
We should figure out how to more sanely integrate with Visual Studio so that 3rd party library providers don't need to stick their assemblies into the Mono for Android reference assemblies directory.
Not sure there's much we can do. If we can't find a way for VS to already support this, there is zero chance we will implementing it.
Third Parties can add the following structure to the registry and have their assemblies appear in the Extensions section in VS 2012
In HKLM or HKCU Software\Microsoft\MonoAndroid\v2.2\AssemblyFoldersEx
They need to add a folder for their Project and set the (Default) key to be the path of the location where the assemblies are installed. for example for ServiceStack there would be a key
and its (Default) REG_SZ value would point to the install directory for the ServiceStack assemblies.
Note this will show up all the assemblies in that folder, so if the framework has multiple versions it will probably be better to split the Android assemblies into their own directory.
This is how both VS 2010 and VS 2012 work.
Using this technique means that third parties do not need to install their assemblies in the Mono for Android installation directory. The fact that is works in HKCU means that this can be done without the need for administrator privileges by an installer (although it will only affect the current user).
If you are a third party and you have written a library which would be useful for other developers you will want to provide an easy way for developers to add that library to their applications.
If they are using Visual Studio the normal method to do this is via the Add References dialog, what would be really nice would be if your assemblies could be listed in that dialog without requiring the user to browse for them.
When building the assemblies list Visual Studio scans certain registry keys based on the .Net runtime version of the active project. In the case for Mono for Android it scans the following keys
Steps to manually add the registry key are.
1) Open regedit.exe
2) Navigate to HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER
You can safely create this key chain if it does not exist.
3) Right click on the AssemblyFoldersEx and click New->Key and type the name of your product or library in the dialog and click ok.
4) Open the new Key and Right click on the (Default) items and click Modify
5) Put the full path to the folder containing your assemblies in the dialog and click ok.
that should be everything you need to do. There is no need to restart Visual Studio clicking Add References should now pick up the new assemblies.
These key values can also be added via installers or scripts.
What is "v2.2" in the above registry key? Is that the $(TargetFrameworkVersion) for the project?
If so, the problem is that this is an unbounded list: there is currently v1.4, v2.1, v2.2, v2.3.3, v3.1, v4.0, v4.0.3, v4.1, and this will only grow (e.g. API 17 will presumably be v4.2). Needing to provide registry keys for every one of those versions will be annoying, and means that things will "break" if/when a new API level comes out.
Is there any form of "version inclusion" supported by the registry keys, so that e.g. HKLM\Software\Microsoft\MonoAndroid\v1.0\AssemblFoldersEx\... is also searched, something akin to C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v4.0\RedistList.xml?
The v2.2 is the Minimum Android version that the third party library supports. So if the library supports only 4.0 features the registry key will be
This will mean the assemblies will be unavailable for projects with a "Minimum Android to Target" version below 4.0. If the framework supports all features on all platforms then v1.0 can be used to ensure that the assemblies appear in all projects.
The registry is searched as well so if your application targets v4.0 the Add References dialog will be populated with assemblies matching any key v4.0 or less, so v3.0, v2.2, v2.1 etc will be included. However v4.1 , v4.0.3 would not be included.
This bug has been in the NEEDINFO state with no changes for the last 90 days. Can we put this back into the NEW or CONFIRMED state, or are we still awaiting response?
If there is no change in the status of this bug over the next two weeks, this bug will be marked as NORESPONSE.
This bug has not been changed from the NEEDINFO state since my previous comment, marking as RESOLVED NORESPONSE.
Please feel free to REOPEN this bug at any time if you are still experiencing the issue. Please add the requested information and set the bug back to the NEW (or CONFIRMED) state.