question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ProgressBar and ProgressRing controls are not working in SDK 1.1 preview 3

See original GitHub issue

Describe the bug

If I include ProgressBar or ProgressRing control on the Window, the app simple does not load. And also the error is not meaningful.

I used the simple XAML: <ProgressBar Width="130" Value="0" />

Error:

Unhandled exception at 0x5BE8BAC9 (Microsoft.ui.xaml.dll) in App3.exe: 0xC000027B: An application-internal exception has occurred (parameters: 0x122D8960, 0x00000002).

Steps to reproduce the bug

  1. Create a new Blank App in WinUI 3 C# with SDK 1.1 Preview 3.
  2. Add a ProgressRing or ProgressBar control on the MainWindow.
  3. Run the app

Expected behavior

The app should start normally when ProgressBar or ProgressRing control is added.

Screenshots

Can’t add screenshot as the app is not starting.

NuGet package version

WinUI 3 - Windows App SDK 1.1 Preview 3: 1.1.0-preview3

Windows app type

  • UWP
  • Win32

Device form factor

Desktop

Windows version

Windows 11 (21H2): Build 22000

Additional context

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
gabbybilkacommented, Jul 20, 2022

This issue was fixed and released in Windows App SDK 1.1.3 - check out the release notes and NuGet to try it out 🎉

1reaction
kmahonecommented, Jun 30, 2022

@hassaanmasood thanks for reporting this issue. The problem is understood and I have a fix available internally.

This issue is hit whenever a ProgressRing, ProgressBar (or a few other controls) are created when Microsoft.Windows.SDK.NET.dll is not already loaded into the process. So it is possible to work-around this issue by forcing Microsoft.Windows.SDK.NET.dll to be loaded before your page/wndow loads. I was able to do this by adding a line of code to my window’s ctor:

        public MainWindow()
        {
            var coreDispatcher = this.Dispatcher;
            this.InitializeComponent();
        }

Even though this line of code doesn’t really do anything, it does have the effect of getting Microsoft.Windows.SDK.NET.dll loaded into the process and so you no longer hit a problem with ProgressRing or ProgressBar. It doesn’t have to be this specific line of code, anything that forces the dll to load should suffice.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ProgressBar Class - Windows App SDK
A ProgressBar control visually indicates progress of an operation with one of two styles: a bar that displays a repeating pattern, or a...
Read more >
WinUI ProgressRing Don't Show on WASM (Uno 2.4)
To use the ProgressRing control, your project heads need to have a reference to the Uno.UI.Lottie package. The rendering of this control is ......
Read more >
ProgressRing
ProgressRing - "WUX ProgressRing " - implementation based on the built-in control in Universal Windows Platform, with support for both native & UWP...
Read more >
Changelog
Changelog. Shoelace follows Semantic Versioning. Breaking changes in components with the Stable badge will not be accepted until the next major version.
Read more >
Stable channel release notes for the Windows App SDK
Fixed an issue where the mouse would sometimes stop working when a dialog ... Check out the 1.1 Preview 3 release notes for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found