Announcing “UWPDesktop” NuGet Package Version 14393

News

Extraordinary Robot
Robot
The UWPDesktop NuGet package is here to improve the developer experience with Visual Studio when walking along the Desktop Bridge.

The Desktop Bridge allows you to call UWP APIs directly from your WinForms, WPF or VB application. You can use APIs such as Live tiles, notifications, App Services and many more!

Previously, calling UWP APIs from a converted app was a confusing process. You had to find and reference the right .dll or .winmd, and it often wasn’t obvious which one to choose.

For example, to use “await” on UWP types, you had to reference the System.Runtime.WindowsRuntime.dll (c:program Files (x86)Reference AssembliesMicrosoftFramework.NETCorev4.5
System.Runtime.WindowsRuntime.dll), which was actually from Windows 8.1 and therefore only worked in conjunction with “facadewindows.winmd” (c:program Files (x86)Windows Kits10UnionMetadataFacadeWindows.WinMD).



AppServiceConnectionStatus status = await connection.OpenAsync();



Confusing, right? The new way is much simpler – just include the latest UWPDesktop NuGet package to your project, and you’re ready to call any supported UWP API without needing additional references.

You have two options for installing the package:

  1. In Visual Studio, right-click on your project, select “Manage NuGet Packages,” and search for and install the UWPDesktop package (as shown in the screenshot below):https://winblogs.azureedge.net/win/2017/01/image1.png
    https://winblogs.azureedge.net/win/2017/01/Picture11.png
  2. Use the Package Manager Console



Install-Package UwpDesktop


Warnings for unsupported UWP APIs


Not all modern APIs can be called directly from your desktop application; for example, you still can’t use XAML or SecondaryTile in your WinForms app. The UWPDesktop NuGet package makes your life easier by raising a warning if you try and call an unsupported API.



For more information and to learn more about the UWPDesktop NuGet package and Desktop Bridge, check out the resources below.

Resources


Continue reading...
 
Back
Top