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 531 [details]
Full message and stacktrace of the bug.
Auto-adding a using block for an unknown classname, removing it using Ctrl+Z, then auto-inserting the full namespace causes an ArgumentOutOfRangeException.
1) Type the name of a class that is unresolved (e.g. not in the same namespace and not declared with a using block)
2) Press Alt+Enter to auto-resolve the class and choose "using <qualifiedclass>"
3) Press Ctrl+Z to undo the using block
4) Press Alt+Enter again, and this time choose to insert the fully qualified name directly in front of the class declaration
9 times out of 10 for me this results in an exception with the attached stacktrace and the following message:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Value has to be >= 0.
Parameter name: sourceIndex
Apologies if this is already resolved, I am still using 2.4 (on Debian).
At least I can't find it with 2.8.
I've no problem reporting 2.4 bugs (btw. the add namespace thing got changed much since 2.4 :))
This bug seems to have come back in the 2.9.x series.
What I'm doing
1) Highlighting type I want to add a namespace for.
2) Hitting ctrl+option+space to open the Autocomplete menu
3) Selecting the Namespace I want to add.
Should be fixed.
(btw. the original bug was about another function)