我正在调用:FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
在我的 uwp 应用程序中启动 win32 应用程序。然后我尝试打开 uwp 和 win32 应用程序之间的连接,并将消息从 uwp 发送到 win32。我创建一个ValueSet valueSet = new ValueSet();
但在编译时,它会抱怨:
Error CS0433 The type 'ValueSet' exists in both
'Windows.Foundation.FoundationContract, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=null, ContentType=WindowsRuntime' and 'Windows,
Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime'
Run Code Online (Sandbox Code Playgroud)
我确实手动添加了引用以便C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Windows.winmd
能够调用 FullTrustProcessLauncher,并且我相信我想使用ValueSet
this 内部的内容Windows.winmd
。
我很困惑它在哪里Windows.Foundation.FoundationContract
,它在我的项目中怎么样?我怎样才能删除它?
谢谢!
这可能与我的位置相似:
C:\Program Files (x86)\Windows Kits\10\References\10.0.17763.0\Windows.Foundation.UniversalApiContract#VerNum#\Windows.Foundation.UniversalApiContract.winmd
会
您无法删除Windows.Foundation.UniversalApiContract,因为它是 Windows SDK 的一部分并且具有依赖项。您可以更新到 SDK 版本 10.0.14393.0 或更高/更低版本来测试您的应用程序。
您拥有 SDK 版本 10.0.10586.0,其中 UniversalApiContract 版本 2.0。
并且您需要切换 UWP 应用程序的目标版本。