Questions tagged [uwp]

The Universal Windows Platform is a common software platform for all devices running Windows 10, including Desktop. This tag should be used for questions regarding developing UWP applications on any of the supported device families. Other tags such as the languages being used (C#, C++, etc.) and the style of API (Win32, WinRT, etc.) can be added. Packaged Win32 Applications should use the Desktop-Bridge tag (possibly in addition to UWP).

Universal Windows Platform

Windows 10 introduced the Universal Windows Platform which was an evolution of the "modern" platform first introduced with Windows 8. UWP replaces the disparate legacy platforms and unifies all Windows devices (Desktop, Xbox, IoT, Surface Hub, HoloLens, etc.). UWP is the focus of all future Windows platform innovation at Microsoft - including on Desktop Windows - with many of the original differences between "UWP apps" and "Desktop Win32 apps" having been removed. UWP consists of Win32, COM, WinRT, and .NET APIs.

UWP introduced or refined several new technologies, many of which are now available to Win32 apps:

  • MSIX (nee AppX) packaging.
  • Declarative extensibility and integration points.
  • AppContainer-based security and privacy.
  • MRT resource packaging and resolution.
  • XAML-based UI, including modern input (touch, pen, and game controller).
  • WinRT platform APIs.
  • The Microsoft Store

MSIX enables the clean install, servicing, and uninstall of applications, including packaged Win32 applications. It enables apps to integrate with the Windows shell and cooperate with other apps via a declarative extension mechanism.

AppContainers run apps with a minimal set of permissions by default, ensuring they are isolated from each other and the system. AppContainers use an explicit permissions-based security model (known as "capabilities") to request additional access to resources like the network, the user's location, or a camera. Packaged Win32 apps do not typically run inside an AppContainer.

MRT is a unified resource management technology, allowing apps to specify resources across a diverse set of axis (language, scale-factor, accessibility, home region, etc.) with the most-applicable candidate being loaded automatically at runtime. MRT is available to Win32 applications.

XAML, the UI framework for UWP, uses a declarative XML dialect to define UI layout. It will be familiar to anyone who has used WPF or Silverlight, but XAML has been updated to better integrate with DirectX rendering and use modern inputs such as touch, pen, and game controller. It is also no longer limited to .NET languages (it is usable from C++) and it can be used from Win32 applications.

The runtime platform consists of a set of Windows Runtime (WinRT) APIs, a growing subset of COM & Win32 APIs, and a cross-platform set of .NET APIs. Most UWP APIs are available on all Windows devices, and most UWP APIs are available to Win32 or Packaged Win32 apps as well. Using the Desktop Extension SDK, Packaged Win32 apps can access virtually any existing Windows API or feature, but only work on Desktop Windows devices. Even if an application uses device-specific functionality, it can still run on other UWP devices if it avoids calling the specialized APIs when they are not available.

UWP apps (including Packaged Win32 apps) can be distributed via the Microsoft Store, but they can also be side-loaded onto most devices with traditional deployment mechanisms (enterprise deployment, web download, MSI-based installers, etc.). By default, all applications created with Visual Studio are able to run on all Windows 10 devices, but developers can restrict distribution in the Microsoft Store to one or more specific devices if they have a technical or business need to do so.

Resources

22264 questions
79
votes
1 answer

What could cause P/Invoke arguments to be out of order when passed?

This is a problem that happens specifically on the ARM, not on x86 or x64. I had this problem reported by a user and was able to reproduce it using UWP on Raspberry Pi 2 via Windows IoT. I've seen this kind of problem before with mismatched…
borrrden
  • 33,256
  • 8
  • 74
  • 109
67
votes
2 answers

Difference between Binding and x:Bind

What to use in UWP, Binding or x:Bind and what is the difference between them? Because I see a lot of posts where people use Binding and I only Bind with x:Bind in UWP. At the MSDN Homepage it only says that "the binding objects created by {x:Bind}…
FoldFence
  • 2,674
  • 4
  • 33
  • 57
59
votes
1 answer

Universal Windows project - HttpClient exception

I'm trying to implement REST client in Universal Windows project (in Windows 10 universal app) using HttpClient, but the following line: var response = _client.GetAsync(address).Result; throws an AggregateException with the following…
Mrk
  • 743
  • 1
  • 6
  • 9
56
votes
4 answers

How to output to console in UWP on Windows 10?

Is there a way to write to console / command prompt / powershell (like Console.WriteLine()) or anything similar in UWP apps? If console is unavailable is there a proper alternative that I can use instead to write to the screen large amounts of…
Bad
  • 4,967
  • 4
  • 34
  • 50
53
votes
1 answer

Retrieve the Current App version from Package

While I can get the assembly version using the following code var assembly = typeof(App).GetTypeInfo().Assembly; var assemblyVersion = assembly.GetCustomAttribute().Version; I would like to retrieve the…
Chris Ballance
  • 33,810
  • 26
  • 104
  • 151
51
votes
3 answers

Getting "Tuple element name is inferred. Please use language version 7.1 or greater to access an element by its inferred name."

We have the following code that has been working fine in our UWP app until today after we updated Visual Studio 2017 to the latest 15.3. private void Test() { var groups = new List<(Guid key, IList<(string, bool)> items)>(); var items = new…
Jessica
  • 2,057
  • 1
  • 15
  • 24
51
votes
3 answers

Difference between .Net Core, Portable, Standard, Compact, UWP, and PCL?

I've heard of .Net Core .Net Portable .Net Standard .Net Compact Universal Windows Platform Portable Class Libraries All of these were explained to me as "a subset of the full .Net that allows you to target multiple platforms". So my questions…
BlueRaja - Danny Pflughoeft
  • 84,206
  • 33
  • 197
  • 283
41
votes
3 answers

await Task.CompletedTask for what?

I created UWP app with Windows Template Studio that introduced at Build2017. Below class is a part of generated code from it. public class SampleModelService { public async Task> GetDataAsync() { await…
Youngjae
  • 24,352
  • 18
  • 113
  • 198
37
votes
1 answer

Delete NoUIEntryPoints-DesignMode packages

When uninstalling programs I see hundreds of packages with the name "NoUIEntryPoints-DesignMode". As a result of my research I have recognized if you debug an UWP-App which registers a file extension it will create this package and the system is not…
TableCreek
  • 799
  • 8
  • 18
37
votes
2 answers

UWP: Alternative to Grid.IsSharedSizeScope and SharedSizeGroup

I got the same issue as described in the following, old, forum post: Issue on MSDN However, for some reason Microsoft decided to remove the functionalities in the answer described there. What I'm looking for is a ListView with 2+ columns, with the…
ManIkWeet
  • 1,298
  • 1
  • 15
  • 36
37
votes
1 answer

Can UWP apps be ported to Windows 7?

Can a Windows 10 app built on the Universal Windows Platform (UWP) be ported back to Windows 7 customers? In particular, one made using XAML?
Jim
  • 869
  • 1
  • 10
  • 16
37
votes
4 answers

Setting window size on desktop for a Windows 10 UWP app

I've just started learning UWP app development on Windows 10 Pro using Visual Studio 2015 Community Edition. I tried to modify the C# version of the official "Hello, World!" sample by setting the Width and Height attributes of the Page tag in…
kol
  • 27,881
  • 12
  • 83
  • 120
36
votes
2 answers

How to create a working trusted and or self-signed certificate for a Windows 10 UWP application via Visual Studio 2019, 2017 and 2015

Per this documentation: https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/makecert The following command describes creating a windows cer-file (i.e. a certificate from a trusted provider.) The issue with this is that when building…
36
votes
1 answer

How to read/interpret a raw C# stack trace correctly?

I'm reading some crash reports from a UWP application (C#, compiled with .NET Native) and I'm having a hard time understanding the exact syntax/format used in the stack traces. I tried looking for some guides on the internet but I didn't come up…
Sergio0694
  • 4,447
  • 3
  • 31
  • 58
36
votes
3 answers

How to exit or close an UWP app programmatically? (Windows 10)

I need it for their own exit button. Tell me please? I try this: this.Close(); //or Exit dont work(
AlexeySRG
  • 791
  • 2
  • 7
  • 12
1
2 3
99 100