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.
When a DLL is referenced in the project, the namespace can´t be accessed through code completion in the text editor. The using code completion does not show the newly added namespace.
It works after closing and reopening the project.
Works for me, but it can take some seconds till the code completion database updates.
Do you have a 'Gathering class information' message in the code completion window after adding the dll ?
If waiting some seconds for this message to disappear doesn't help I need more info about the exact use case (which dll etc.) since in my tests all seems to be working.
I´m using MonoDevelop 18.104.22.168. The referenced DLL is the Newtonsoft.json.MonoDroid.dll available at GitHub https://github.com/chrisntr/Newtonsoft.Json
I´m adding the reference to the DLL to the MonoAndroid project in MonoDevelop and when I try to add the "using Newtonsoft..." clause it shows "No matches".
I have waited for more than a minute, tried to rebuild the project, tried to close all editor tabs and reopen the CS file, nothing helps.
When I close the solution and open it again, everything works fine, the "Newtonsoft" appears in the code completion and everything is fine.
This probably has something to do with the fact the Mono for Android projects use MSBuild/xbuild, which means that assembly references are resolved using MSBuild/xbuild.
Mike, try enabling experimental xbuild support in MD prefs and restarting MD. Then you should be able to reproduce this for all project types.
However we still have an underlying issue with that. The event chain doesn't work in that case
After the project reference added/removed events the references of the project are the ones before the event and are not updated until the msbuild project is saved.
The save occurs after the update & after the reference addde/remove event. That doesn't seem very trivial to fix. I would 'just' always take the info from the project structures and not from the msbuild file, but I don't change that because I don't know enough about side effects there.
But that's a bug in the event chain.
The reason that we resolve references from MSBuild is that it considers many more build variables, build conditions and reference sources than MD does. It's guaranteed to give us the references that'll be used by the compiler. VS does the same.
@Michael: You mean that vs.net shares the bug that after the reference added event the list of references are wrong ? oO
No, why do you say that? Using MSBuild to resolve doesn't mean that you have to have event chain bugs.
> VS does the same.
I talked about the bug and not about MSBuild also I'm not really sure if a very complex case would be needed atm - we just have the refs in the dialog and monodevelop knows which dll gets referenced.
But in any case it'll be a bug if we've a case that's not easy resolveable and gets added with add project refrence because at that time it's atm not possible to get the msbuild resolved assemblies.
*** Bug 1077 has been marked as a duplicate of this bug. ***