Reputation: 2278
Hi I am trying to use the Windows.ApplicationModel as in this example https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/Package
However I am unable to import the dll.
using Windows.ApplicationModel;
results in an error although I am using .NET Version where it should exist. Also I cannot find it when I try to add the reference. Any Ideas?
I need it to get some packe Informations about Programs that run in the ApplicationFrameHost.
Upvotes: 4
Views: 5554
Reputation: 2881
For targeting Windows 10 (version 1809?) and greater using .Net 6 and greater the namespaces are automatically available. In a new WPF project created using Visual Studio 2022 if I have Supported OS Version set to 10.0.17763.0
or higher then I can use a class in Windows.ApplicationModel.DataTransfer
and I assume that applies for all of Windows.ApplicationModel
.
Upvotes: 0
Reputation: 83
From what I can tell, you need the Windows SDK 17134 version that comes with the UWP development package in the installer. Then you can use that namespace. Google also led me to this link which might help: https://blogs.windows.com/buildingapps/2017/01/25/calling-windows-10-apis-desktop-application/
Upvotes: 1