question

23864860 avatar image
0 Votes"
23864860 asked pesmith answered

UWP like default VPN application

I'am developer of VPN application. How can i set my application as default VPN for user profile at Windows,if network is unsecure? Like at IOS "connect on demand". And i need to do this from my C# code.

windows-uwp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

NicoZhu-MSFT avatar image
0 Votes"
NicoZhu-MSFT answered

Hello, Welcome to Micorosoft Q&A,

Your issue that might be related to VPN proxy network and I'm afraid is not suitable to discuss in the Forum. For your scenario, I suggest that you might need to open a support ticket for this. Please contact our paid phone support at MS Support. You will get 1:1 support on that. Select Developer Tools -> Windows UWP Development -> Windows 10 Universal App Dev -> System Services Development-> Networking API in the support page and you could contact the team. Please kindly note that your support ticket will be free if it is Microsoft's issue.



If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

pesmith avatar image
0 Votes"
pesmith answered

There's no built-in way to do this automatically. The VPNv2CSP shows you what can be set from a VPN profile. There's a trigger for "trusted" networks, but that's used by enterprise IT admins to decide what's in and out of the corporate network.

You can turn your profile on and off programmatically. The VpnManagementAgent has methods to ConnectProfileAsync and DisconnectProfileAsync; you can call them yourself as needed. However, this will be difficult to truly automate. There are background triggers, but I've never gotten the "network changed" trigger to work from a background task.

FYI: you probably already know this, but it's really hard to know if a network is "secure" or not. Many enterprises consider all networks except for their own corporate network to be insecure; other people might only consider "public" networks to be insecure.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.