Bug 7329 - GetNetworkInterfaces causes an System.ArgumentException when Personal Hotspot turned on
Summary: GetNetworkInterfaces causes an System.ArgumentException when Personal Hotspot...
Status: RESOLVED DUPLICATE of bug 6413
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 5.3.x
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-09-20 08:44 UTC by Dermot
Modified: 2012-09-20 09:14 UTC (History)
2 users (show)

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


Attachments
Sample project. (8.40 KB, application/zip)
2012-09-20 08:44 UTC, Dermot
Details


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 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.

Related Links:
Status:
RESOLVED DUPLICATE of bug 6413

Description Dermot 2012-09-20 08:44:26 UTC
Created attachment 2580 [details]
Sample project.

Version Info:
MonoDevelop 3.0.4.7
Installation UUID: (removed)
Runtime:
	Mono 2.10.9 (tarball)
	GTK 2.24.10
	GTK# (2.12.0.0)
	Package version: 210090011
Apple Developer Tools:
	 Xcode 4.5 (1839)
	 Build 4G182
Monotouch: 6.0.0
Mono for Android: Not Installed

Build information:
	Release ID: 30004007
	Git revision: ea0108260c6a376ecaeffcdb7d03387bd51edda3
	Build date: 2012-09-17 14:09:17+0000
	Xamarin addins: ec43fd5cb223ead4234a9858d1b56eef03dad53a-dirty
Operating System:
	Mac OS X 10.8.2
	Darwin MacbookAir.local 12.2.0 Darwin Kernel Version 12.2.0
	    Sat Aug 25 00:48:52 PDT 2012
	    root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64


Calling GetNetworkInterfaces() when personal hotspot is turned on causes an ArgumentException on the length property. At System.Array.Copy. More info by just calling System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces() when personal hotspot turned on.




How to reproduce.
Use on device, ios6. I am testing on an iPhone 4S.

Either download and use the sample app, or create a new Single view project, and replace its ViewDidLoad method with the code below (including the Alert() and the testButton declaration):

public UIButton testButton;

		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			testButton = UIButton.FromType(UIButtonType.RoundedRect);
			testButton.Frame = new RectangleF(20f,100f,200f,44f);
			testButton.SetTitle("GetNetworkInterfaces()",UIControlState.Normal);

			View.AddSubview(testButton);

			testButton.TouchUpInside+= delegate {
			
				try
				{
					// Perform any additional setup after loading the view, typically from a nib.
					var interfaces = System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces();
					Alert(interfaces.Length.ToString() + " interfaces found.");
				}
				catch(Exception error)
				{
					Alert(error.ToString());
				}

			};

		}

		public void Alert(string message)
		{
			InvokeOnMainThread(delegate{
				UIAlertView alert = new UIAlertView("Message",message,null,"OK",null);
				alert.Show();
			});
		}
Comment 1 Rolf Bjarne Kvinge [MSFT] 2012-09-20 09:14:48 UTC

*** This bug has been marked as a duplicate of bug 6413 ***