PNRP停止运行Windows 10 1803

时间:2018-06-25 08:24:32

标签: windows wcf pnrp

我有一些使用PNRP的代码来发现网络上的对等体。自Windows 10更新1803起,一切正常。

public void Init()
    {
        try
        {
            _ServiceUrl = Dns.GetHostAddresses(Dns.GetHostName()).Where(address => address.AddressFamily == AddressFamily.InterNetwork).Select(address => _Address = address).Select(address => $"net.tcp://{address}:{Port}/SiemensVR").FirstOrDefault();

            if (string.IsNullOrEmpty(_ServiceUrl)) return;

            _LocalProxy = new PeerProxy(_EventAggregator, this);
            _Host = new ServiceHost(_LocalProxy, new Uri(_ServiceUrl));

            var binding = new NetTcpBinding();
            binding.Security.Mode = SecurityMode.None;

            _Host.AddServiceEndpoint(typeof(IPeerContract), binding, new Uri(_ServiceUrl));
            _Host.Open();

            _PeerName                     = new PeerName(PEER_NAME_ID, PeerNameType.Unsecured);
            _PeerNameRegistration         = new PeerNameRegistration(_PeerName, Port) { Cloud = Cloud.AllLinkLocal };
            _PeerNameRegistration.Comment = _UserId.ToString();
            _PeerNameRegistration.Start();

            ResolvePeers();
        }
        finally { }
    }

    private async void ResolvePeers()
    {
        var resolver = new PeerNameResolver();
        resolver.ResolveProgressChanged += OnResolveProgressChanged;
        resolver.ResolveCompleted += (s, e) =>
        {
            Console.WriteLine("Completed");
        };

        resolver.ResolveAsync(_PeerName, this);

        await Task.Delay(1000);

        resolver.ResolveAsyncCancel(this);
    }

MS是否已用某种东西取代了PNRP?

我已经测试过激活pnrp服务,重新安装teredo隧道等功能。

3 个答案:

答案 0 :(得分:1)

Microsoft已弃用并且正在删除PNRP。 您不走运,因为它的服务和客户端API已被完全删除。

请参见https://docs.microsoft.com/en-us/windows/deployment/planning/windows-10-deprecated-features

答案 1 :(得分:0)

这里有同样的问题...如果找到任何解决方法,请告诉我。

以前,我们的应用程序可以正常运行,但是在1803年它不再起作用。我可以看到云开始同步,然后每个对等点最终都变成单独的状态。

答案 2 :(得分:0)

同一问题,我找到了Microsoft便笺,将以下服务设置为“自动延迟启动”:

Computer Browser (Browser) <- Set to Automatic, not delayed start
Function Discovery Provider Host (FDPHost)
Function Discovery Resource Publication (FDResPub)
Network Connections (NetMan)
UPnP Device Host (UPnPHost)
Peer Name Resolution Protocol (PNRPSvc)
Peer Networking Grouping (P2PSvc)
Peer Networking Identity Manager (P2PIMSvc)

但是它不能解决问题。

解决这个问题有进展吗?