Search code examples
c#uwpwindows-10

How to access Windows.Management.Deployment namespace in a Desktop project in VS2017?


Question: Where in Windows 10 we can find Windows.Management.Deployment.dll or how can we install it?

In a WinForm project in VS2017 - ver 15.9.6 I'm trying to follow C# example of PackageManager.FindUsers(String) method that uses classes from Windows.Management.Deployment namespace.

But can't seem to find the location of above dll that is needed to add a reference in VS2017 project. I installed UwpDestop NuGet package, also add a reference to windows.winmd file, but that did not help either. I'm using Windows 10 Pro- Update 1809.


Solution

  • In your Winforms project you need to go to "Add Reference …" and hit the "Browse" button. Then navigate here and select the Windows.winmd file that corresponds to the Windows SDK you are targeting. Be sure to change the file extension filter to .

    enter image description here