桌面桥-引用在17134中不起作用

时间:2018-08-10 10:17:06

标签: c# wpf windows uwp desktop-bridge

像这样调用UWP API:

var channel = await Windows.Networking.PushNotifications.PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();

在编译时出现错误:

The type name 'PushNotificationChannelManager' could not be found in the namespace 'Windows.Networking.PushNotifications'. This type has been forwarded to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' Consider adding a reference to that assembly

发生这种情况只是创建一个新的WPF应用并添加对以下内容的引用:

  1. C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Facade\Windows.WinMD
  2. C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\System.Runtime.WindowsRuntime.dll

1 个答案:

答案 0 :(得分:-1)