Greenboat
NetworkInformation.GetConnectionProfiles() when broadcasting mobile hotspot in Windows 11
So I'm currently trying to build an application where devices can communicate over mobile hotspot (can't be internet, has to be a local network because they haven't got internet where this app needs to be used). While debugging, I set my PC to broadcast mobile hotspot whilst using a wired ethernet connection, connect my phone to the hotspot to ensure it's working and then call
NetworkInformation.GetConnectionProfiles();
. I look at the collection, and it only shows me the ethernet adapter, and my PC's bluetooth adapter, but not the wifi adapter which I'm fairly sure is there. If I unplug the ethernet cable and instead run my internet on wifi, the network adapter shows up when I call that method.
Am I doing something wrong? I just need to check if I'm running a hotspot so I know if my app can receive requests from other devices. Or, should I be using something else?11 replies