Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve debugging experience for missing resource #6073

Closed
2 tasks done
cfgiugliano opened this issue Oct 9, 2021 · 3 comments
Closed
2 tasks done

Improve debugging experience for missing resource #6073

cfgiugliano opened this issue Oct 9, 2021 · 3 comments
Labels
area-ErrorHandling Issues related to error reporting and debugging feature proposal New feature proposal product-winui3 WinUI 3 issues team-Markup Issue for the Markup team v1.0.0-preview2
Milestone

Comments

@cfgiugliano
Copy link

cfgiugliano commented Oct 9, 2021

Describe the bug

In the following example I am using a ListView with a custom DataTemplate but such template is using a StaticResource which isn't defined. The result is an unhandled exception which doesn't give enough details to the developer to debug the problem.

Steps to reproduce the bug

Define and use a DataTemplate which uses an undefined StaticResource like in the example below (SmallFontSize isn't defined anywhere).

Expected behavior

I expect the behavior to be notifying the developer that the StaticResource can't be found or that something is wrong with the DataTemplate.

For example if the missing StaticResource is used by a control and not in a DataTemplate definition, the Exception Thrown says that XAML parsing failed.

Screenshots

The example
Immagine 2021-10-09 165913

The exception
Immagine 2021-10-09 165815
Immagine 2021-10-09 170311

NuGet package version

WinUI 3 - Windows App SDK 0.8: 0.8.0 (If you're seeing your issue in older previews of WinUI 3, please try this release)

Windows app type

  • UWP
  • Win32

Device form factor

Desktop

Windows version

May 2021 Update (19043)

Additional context

I am using the single project template from WindowsAppSDK 1.0 Preview 2 but I have the same behaviour using the Microsoft.ProjectReunion.WinUI 0.8.4 nuget with the app+package template.

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Oct 9, 2021
@asklar
Copy link
Member

asklar commented Oct 10, 2021

thanks for filing @cfgiugliano

CC @kmelmon @RealTommyKlein @MikeHillberg

@michael-hawker
Copy link
Collaborator

Related to #4972, #3971, and #2350.

I just hit this again in UWP where a ThemeResource was used in a DataTemplate that didn't exist. Just get a COM exception in MeasureOverride of the parent control which is completely unhelpful. If I didn't think about invalid resources like this, could have been a test of patience and frustration to figure out what was going on.

@StephenLPeters StephenLPeters added feature proposal New feature proposal product-winui3 WinUI 3 issues team-Markup Issue for the Markup team labels Oct 20, 2021
@Scottj1s Scottj1s added the area-ErrorHandling Issues related to error reporting and debugging label Oct 7, 2022
@bpulliam bpulliam removed the needs-triage Issue needs to be triaged by the area owners label Dec 6, 2022
@gabbybilka gabbybilka added this to the WinUI 3 in WinAppSDK 1.3 milestone Feb 15, 2023
@gabbybilka
Copy link
Member

🎉Microsoft.WindowsAppSDK v1.3.0 has been released which fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-ErrorHandling Issues related to error reporting and debugging feature proposal New feature proposal product-winui3 WinUI 3 issues team-Markup Issue for the Markup team v1.0.0-preview2
Projects
None yet
Development

No branches or pull requests

7 participants