Bug 13176 - NullReferenceException when opening solution properties
Summary: NullReferenceException when opening solution properties
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 1.1.x
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Jose Miguel Torres
URL:
Depends on:
Blocks:
 
Reported: 2013-07-11 10:25 UTC by Pierre-Andre van Leeuwen
Modified: 2013-11-20 06:40 UTC (History)
5 users (show)

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

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 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:
Status:
RESOLVED FIXED

Description Pierre-Andre van Leeuwen 2013-07-11 10:25:32 UTC
I'm using Visual Studio 2012. The error occurs when right-clicking on the solution and selecting Properties. The error messages below are printed in the Output window (Debug). When right-clicking and selecting "Set Startup Projects", nothing happens, except the same messges are printed in the debug window. 

Mono.IOS.VisualStudio.MonoTouchPackage Error: 0 : Background task error
System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. ---> System.ArgumentOutOfRangeException: InvalidArgument=Value of '0' is not valid for 'SelectedIndex'.
Parameter name: SelectedIndex
   at System.Windows.Forms.ComboBox.set_SelectedIndex(Int32 value)
   at Microsoft.VisualStudio.CodeAnalysis.SolutionPage.UpdateComboBoxesAndProjectList(Task t)
   at Microsoft.VisualStudio.CodeAnalysis.SolutionPage.<.ctor>b__0(Task t)
   at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.ArgumentOutOfRangeException: InvalidArgument=Value of '0' is not valid for 'SelectedIndex'.
Parameter name: SelectedIndex
   at System.Windows.Forms.ComboBox.set_SelectedIndex(Int32 value)
   at Microsoft.VisualStudio.CodeAnalysis.SolutionPage.UpdateComboBoxesAndProjectList(Task t)
   at Microsoft.VisualStudio.CodeAnalysis.SolutionPage.<.ctor>b__0(Task t)
   at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()<---

Mono.IOS.VisualStudio.MonoTouchPackage Error: 0 : Background task error
System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. ---> System.ArgumentOutOfRangeException: InvalidArgument=Value of '0' is not valid for 'SelectedIndex'.
Parameter name: SelectedIndex
   at System.Windows.Forms.ComboBox.set_SelectedIndex(Int32 value)
   at Microsoft.VisualStudio.CodeAnalysis.SolutionPage.UpdateComboBoxesAndProjectList(Task t)
   at Microsoft.VisualStudio.CodeAnalysis.SolutionPage.<.ctor>b__0(Task t)
   at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.ArgumentOutOfRangeException: InvalidArgument=Value of '0' is not valid for 'SelectedIndex'.
Parameter name: SelectedIndex
   at System.Windows.Forms.ComboBox.set_SelectedIndex(Int32 value)
   at Microsoft.VisualStudio.CodeAnalysis.SolutionPage.UpdateComboBoxesAndProjectList(Task t)
   at Microsoft.VisualStudio.CodeAnalysis.SolutionPage.<.ctor>b__0(Task t)
   at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()<---
Comment 1 Marek Habersack 2013-07-11 10:37:06 UTC
Pierre-Andre,

From the stack trace it seems that the Xamarin.iOS extension is merely reporting on an exception thrown by code analysis code somewhere in Visual Studio. I'll assign Jose to investigate this further, but at this moment is seems that this is happening outside our playground. Jose, can you take a look?
Comment 2 Jose Miguel Torres 2013-07-11 10:47:43 UTC
Hi Pierre,

Do you have the Xamarin.Android installed? COuld you provide the Xamarin.* extensions versions you have installed?

Thanks!
Comment 3 Pierre-Andre van Leeuwen 2013-07-11 10:55:47 UTC
Hi Jose

I do have Xamarin.Android installed, but it's not licenced.
Under VS Extensions I see the following:
 - Xamarin.Shell Version 1.0
 - Xamarin.Android Version 4.6.8007
 - Xamarin.iOS Version 1.1.200

Visual Studio is 2012 with Update 3, but the problem existed with Update 2 as well.

There are a number of posts on the web about this error, often caused by NuGet packages. I won't be surprised if that's the case here as well.
Comment 4 Jose Miguel Torres 2013-07-11 11:17:48 UTC
Did you try to re-install the iOS plugin? Looks like there is a problem with the Shell. Check it out and let me know...

Thanks,
Comment 5 PJ 2013-11-19 17:04:27 UTC
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.
Comment 6 Pierre-Andre van Leeuwen 2013-11-20 03:27:25 UTC
I can confirm that it is still a problem on Xamarin.iOS 1.4. However, I just installed 1.8 and it seems to be fixed.
Comment 7 Marek Habersack 2013-11-20 06:40:01 UTC
Closing the report as per comment 6, thanks Pierre-Andre!