Reputation: 3338
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!
Upvotes: 6
Views: 21823
Reputation: 371
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
Upvotes: 6
Reputation: 564
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.
Upvotes: 5
Reputation: 3338
I figured it out: I reference to Windows.winmd in my uwp application incorrectly. If you convert a win32 application as part of a uwp application. In the uwp application, you should refer to "Windows Desktop Extensions for the UWP". In the win32 application, if you would like to use uwp features, you need to refer to Windows.winmd.
Upvotes: 5