Saturday, March 25, 2017 ..:: Home ::.. Register  Login

Peter Henry on Facebook  Peter Henry on LinkedIn  Peter Henry on Twitter

All blog entries are the opinions of the author and do not necessarily reflect the opinions of their employer. All the code presented is for explanation and demonstration purposes only. Any damages incurred to your site and/or data are not the responsibility of the author. Every effort is taken to ensure the code properly compiles, however sometimes there are some hiccups and you might be required to do your own debugging.
   TechTidBits (Blog)  

Is this another bug with the WP7 emulator?

Apr 10

Written by:
Saturday, April 10, 2010 3:07 PM  RssIcon

WP7I think I might have found another but with the WP7, is the NetworkInterface.GetIsNetworkAvailable supposed to always return false?


Yesterday I was playing around with my app for Ottawa IT Day and well, I thought, hhhmm what happens if you're on your WP7 BUT you don't have network access.....What happens to all those web page calls?  After scratching my very thinning head of hair, I realized there HAS to be a way to check the network access.  And BINGO, there it was, NetworkInterface.GetIsNetworkAvailable()

The thing is, when I use it in the WP7 emulator, it always returns me back false, BUT all the network calls work.  hhhmmm is it lying to me?

Network check fails, but does it really?

Why is the NetworkInterface.GetIsNetworkAvailable() returning me back false when I AM connected to the internet.  hhhmmm maybe I'm doing something wrong, so off to a Silverlight app I go.  hhhmmmm works there.

Works in Silverlight

So I guess I have found a bug with the WP7 emulator.  I'm sure it'll get fixed soon.  Until then, I think I will continue to use this, but have to figure out a way around the fact that it's lying to me.  Now it's time to grab a coffee and get coding.



MSDN: NetworkInterface.GetIsNetworkAvailable Method

WP7 Forums posting

Location: Blogs Parent Separator TechTidBits

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Add Comment   Cancel 
Copyright 1999-2012 by   Terms Of Use  Privacy Statement