Question

When calling GetAllNetworkInterfaces() via:

INetworkInterface[] rgni = WirelessZeroConfigNetworkInterface.GetAllNetworkInterfaces();

I'm only getting back a single adapter back, RNDISFN1, which has a link-local address (169.254....).
I suspect something bad is happening to cause all of the adapters to not be populated in the array; under the debugger, when I fire off the function, I'm seeing:

A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll
A first chance exception of type 'System.ComponentModel.Win32Exception' occurred in CSharpSample.exe
A first chance exception of type 'System.MissingMethodException' occurred in OpenNETCF.Net.dll
A first chance exception of type 'OpenNETCF.Net.NetworkInformation.NetworkInformationException' occurred in OpenNETCF.Net.dll

To be clear, the end goal of this is to get a list of Wireless Profiles, and have the ability to switch between them.

For now, has anybody seen instances where GetAllNetworkInterfaces() doesn't return all of the adapters? I am using version OpenNetCF SDF v2.3 under Windows Mobile 6.

Was it helpful?

Solution

The fact you see a single adapter (and I can tell by the name) indicates that you're cradled. ActiveSync, in all its glory, shuts down all other radios when cradled and therefore no other radios will show up. Run the code when not cradled and you'll likely see your WiFi (and any other) adapters appear.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top