Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is Windows.Foundation.UniversalApiContract?

Tags:

c#

reference

uwp

I am calling: FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync(); to launch a win32 application in my uwp application. Then I am trying to open the connection between my uwp and win32 application, and send a message from uwp to win32. I create a ValueSet valueSet = new ValueSet();

But at compile time, it complains:

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'  

I do manually add the reference to C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Windows.winmd to be able to call FullTrustProcessLauncher, and I believe I want to use the ValueSet inside this Windows.winmd.

I am confused where is the Windows.Foundation.FoundationContract, how it is in my project? How could I remove it?

Thanks!

like image 595
spspli Avatar asked Dec 15 '22 00:12

spspli


2 Answers

This is likely in a similar location as mine:

C:\Program Files (x86)\Windows Kits\10\References\10.0.17763.0\Windows.Foundation.UniversalApiContract#VerNum#\Windows.Foundation.UniversalApiContract.winmd

Wil

like image 197
PixelSyndicate Avatar answered Dec 17 '22 01:12

PixelSyndicate


You can't remove Windows.Foundation.UniversalApiContract, because is part of Windows SDK and has dependencies. You might update to SDK version 10.0.14393.0 or greater/lower for test you app.

You have the SDK version 10.0.10586.0 where is UniversalApiContract version 2.0.

Windows Universal Platform SDK API contracts

Windows SDK and emulator archive (to download & install)

And you need to switch the target version of your UWP app.

like image 33
Sieg Avatar answered Dec 17 '22 02:12

Sieg