[Critical] GetXamlTypeByName(string typeName) fails for typename Windows.UI.Xaml.Controls.RevealBackgroundBrush
See original GitHub issueDescribe the bug
TypeName: “Windows.UI.Xaml.Controls.RevealBackgroundBrush”
Demo project is in here: App1.zip
Steps to reproduce the bug
Steps to reproduce the behavior:
- Install Microsoft.UI.Xaml 2.5.0
- Override OnWindowCreated(WindowCreatedEventArgs args) in App.cs
- Set a break point on it
- Set break on FileNotFoundException
- Make sure you use any Controls from Microsoft.UI.Xaml
- Run demo app in X64 Debug mode
- Wait until VS hit the break point on “OnWindowCreated”
- Wait for a few seconds
- Press F5 to continue
- Got the exception.
System.Private.CoreLib.dll!System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(System.Reflection.AssemblyName assemblyName) Unknown
System.Private.CoreLib.dll!System.Runtime.Loader.AssemblyLoadContext.ResolveUsingResolvingEvent(System.IntPtr gchManagedAssemblyLoadContext, System.Reflection.AssemblyName assemblyName) Unknown
[Native to managed conversion]
[Managed to native conversion]
System.Private.CoreLib.dll!System.RuntimeTypeHandle.GetTypeByName(string name, bool throwOnError, bool ignoreCase, bool reflectionOnly, ref System.Threading.StackCrawlMark stackMark, System.IntPtr pPrivHostBinder, bool loadTypeFromPartialName) Unknown
System.Private.CoreLib.dll!System.RuntimeType.GetType(string typeName, bool throwOnError, bool ignoreCase, bool reflectionOnly, ref System.Threading.StackCrawlMark stackMark) Unknown
System.Private.CoreLib.dll!System.Type.GetType(string typeName) Unknown
Microsoft.UI.Xaml.Markup.winmd!Microsoft.UI.Xaml.Markup.ReflectionXamlMetadataProvider.GetNonGenericType(string compilerTypeName = "Windows.UI.Xaml.Controls.RevealBackgroundBrush") Unknown
Microsoft.UI.Xaml.Markup.winmd!Microsoft.UI.Xaml.Markup.ReflectionXamlMetadataProvider.CreateXamlType(string typeName) Unknown
Microsoft.UI.Xaml.Markup.winmd!Microsoft.UI.Xaml.Markup.ReflectionXamlMetadataProvider.getXamlType(string typeName) Unknown
> App1.exe!App1.App1_XamlTypeInfo.XamlTypeInfoProvider.GetXamlTypeByName(string typeName = "Windows.UI.Xaml.Controls.RevealBackgroundBrush") Line 136 C#
App1.exe!App1.App1_XamlTypeInfo.XamlMetaDataProvider.GetXamlType(string fullName = "Windows.UI.Xaml.Controls.RevealBackgroundBrush") Line 100 C#
App1.exe!App1.App.GetXamlType(string fullName = "Windows.UI.Xaml.Controls.RevealBackgroundBrush") Line 49 C#
Expected behavior
Should not throw any exception. It might throw a lot of FileNotFoundException which cause my app stop responding for about 20 seconds on startup
Version Info
NuGet package version: [Microsoft.UI.Xaml 2.5.0] [Microsoft.UI.Xaml 2.6.0-latestprelease]
Windows app type:
UWP | Win32 |
---|---|
Yes |
Windows 10 version | Saw the problem? |
---|---|
Insider Build (xxxxx) | |
October 2020 Update (19042) | Yes |
May 2020 Update (19041) | |
November 2019 Update (18363) | |
May 2019 Update (18362) | |
October 2018 Update (17763) | |
April 2018 Update (17134) | |
Fall Creators Update (16299) | |
Creators Update (15063) |
Device form factor | Saw the problem? |
---|---|
Desktop | Yes |
Xbox | |
Surface Hub | |
IoT |
Additional context If we don’t set any break point on OnWindowCreated or any other function, or do not use any Controls from Microsoft.UI.Xaml. This issue will not be triggered.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (9 by maintainers)
Top Results From Across the Web
GetXamlTypeByName(string typeName) fails for ...
GetXamlTypeByName (string typeName) fails for typename Windows.UI.Xaml.Controls.RevealBackgroundBrushClosed - Other Product View resolution
Read more >Provider.GetXamlType on ARM64 · Issue #2042
[Critical] GetXamlTypeByName(string typeName) fails for typename Windows.UI.Xaml.Controls.RevealBackgroundBrush #5011.
Read more >global::Windows.UI.Xaml.Markup.IXamlType ...
IXamlType GetXamlTypeByName is called with the typeName = "Microsoft. ... throws exception when trying to load Microsoft.UI.Xaml.Controls.
Read more >[UWP] Could not find or load a specific file. (Exception from ...
My UWP app is throwing exception and crashing on start up giving the following error in the file XamlTypeInfo.g.cs System.IO.
Read more >Untitled
Create new Uwp project ( UI-Project) Add false in to the project file. ... the bug TypeName: "Windows.UI.Xaml.Controls.RevealBackgroundBrush" Demo project ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think it might the same issue as https://github.com/microsoft/microsoft-ui-xaml/issues/2042
After set this to .proj file, issue gone.
I could not repro this in another computer. Might be related to environment