【发布时间】:2019-11-01 08:44:44
【问题描述】:
我正在尝试使用 UWP 创建 VPN 连接,但当它运行时,我从 AddProfileFromObjectAsync() exception message 收到异常。
auto mgr = ref new VpnManagementAgent();
auto profile = ref new VpnNativeProfile();
profile->AlwaysOn = false;
profile->NativeProtocolType = VpnNativeProtocolType::L2tp;
profile->ProfileName = "TestVpn";
profile->RememberCredentials = true;
profile->RequireVpnClientAppUI = true;
profile->RoutingPolicyType = VpnRoutingPolicyType::ForceAllTrafficOverVpn;
profile->TunnelAuthenticationMethod = VpnAuthenticationMethod::PresharedKey;
profile->UserAuthenticationMethod = VpnAuthenticationMethod::Mschapv2;
profile->Servers->Append("45.87.213.134");
auto profileStatus = mgr->AddProfileFromObjectAsync(profile);
【问题讨论】:
-
“访问被拒绝”通常会试图告诉您您忘记在 appx 清单中请求该功能。
-
@Hans Passant,告诉我怎么做或清单中的哪些地方是必要的参数?