title: WiFi Direct and VPN
body: <p>I have an application that controls a camera over a WiFi direct connection. It connects to the camera by enumerating available networks with NetworkAdapter.NetworkReport.AvailableNetworks and then calling NetworkAdapter.ConnectAsync to connect.
  This works fine on most systems. On some systems, however there appears to be a conflict with installed VPNs. If a VPN is installed on the system, sometimes after connection network requests to specific IP addresses on the WiFi direct device fail to be routed correctly. (requests are always to IP addresses on this device). The requests appear to be routed improperly by the VPN and fail to resolve. The really odd thing is that this only happens sometimes. I can issue the same request five times in a row, and 4 of them might fail, but one succeed.</p>
  
  <p>Question - how to temporarily disable the VPN, or at least stop it from interfering with the routing of requests for this particular connection?</p>
  
  <p>There doesn't appear to be anything on the NetworkAdapter class about dealing with routing or VPN.
  I've looked at the VPN namespace
  <a href="https://docs.microsoft.com/en-us/uwp/api/windows.networking.vpn.vpndomainnameinfo" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/uwp/api/windows.networking.vpn.vpndomainnameinfo</a>
  But that appears to be mainly about setting up VPNs on the device and requires special store permissions to use.
  The WiFiDirectDevice class appears to be about setting up a WiFiDirect connection to the hosting device, not connecting to another device.</p>