我正在调用: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'

我确实手动添加了对 C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Windows.winmd 的引用以便能够调用 FullTrustProcessLauncher,并且我相信我想在这个 ValueSet 中使用 Windows.winmd

我很困惑 Windows.Foundation.FoundationContract 在哪里,它在我的项目中如何?我怎么能去掉它?

谢谢!

最佳答案

您不能删除 Windows.Foundation.UniversalApiContract,因为它是 Windows SDK 的一部分并且具有依赖项。
您可能会更新到 SDK 版本 10.0.14393.0 或更高/更低版本以测试您的应用程序。

您的 SDK 版本为 10.0.10586.0,其中 UniversalApiContract 版本为 2.0。

Windows Universal Platform SDK API contracts

Windows SDK and emulator archive (to download & install)

并且您需要切换 UWP 应用的目标版本。

关于c# - Windows.Foundation.UniversalApiContract 在哪里?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/42493271/

10-17 02:12