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

DebugSettings.LayoutCycleTracingLevel throws InvalidCastException #9827

Closed
daltzctr opened this issue Jul 17, 2024 · 2 comments
Closed

DebugSettings.LayoutCycleTracingLevel throws InvalidCastException #9827

daltzctr opened this issue Jul 17, 2024 · 2 comments
Labels
area-Layouts bug Something isn't working Crash whenever user reports a crash or app freeze needs-author-feedback Asked author to supply more information. no-recent-activity team-Controls Issue for the Controls team

Comments

@daltzctr
Copy link

Describe the bug

Attempting to set LayoutCycleTracingLevel in a MAUI project with Windows App SDK 1.5 results in an InvalidCastException. I've attached the stacktrace below.

   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs:line 849
   at WinRT.IObjectReference.As[T](Guid iid) in WinRT\IObjectReference.cs:line 111
   at Microsoft.UI.Xaml.DebugSettings.Make___objRef_global__Microsoft_UI_Xaml_IDebugSettings3() in C:\__w\1\s\BuildOutput\obj\x86fre\src\projection\generated\Microsoft.UI.Xaml.cs:line 1792
   at Microsoft.UI.Xaml.DebugSettings.get__objRef_global__Microsoft_UI_Xaml_IDebugSettings3() in C:\__w\1\s\BuildOutput\obj\x86fre\src\projection\generated\Microsoft.UI.Xaml.cs:line 1795
   at Microsoft.UI.Xaml.DebugSettings.set_LayoutCycleTracingLevel(LayoutCycleTracingLevel value) in C:\__w\1\s\BuildOutput\obj\x86fre\src\projection\generated\Microsoft.UI.Xaml.cs:line 1889
   at phoenix_tuner_x.AppShell..ctor() in C:\phoenix-6\projects\Tuner-X\AppShell.xaml.cs:line 47
   at phoenix_tuner_x.App..ctor() in C:\phoenix-6\projects\Tuner-X\App.xaml.cs:line 32
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) in /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs:line 57
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) in /_/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/CallSiteRuntimeResolver.cs:line 69
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) in /_/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/CallSiteVisitor.cs:line 48
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context) in /_/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/CallSiteRuntimeResolver.cs:line 92
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument) in /_/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/CallSiteVisitor.cs:line 27
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) in /_/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/CallSiteRuntimeResolver.cs:line 30
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier) in /_/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceProvider.cs:line 216
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) in /_/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentDictionary.cs:line 1181
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope) in /_/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceProvider.cs:line 176
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType) in /_/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceProvider.cs:line 101
   at Microsoft.Maui.MauiContext.WrappedServiceProvider.GetService(Type serviceType) in Microsoft.Maui\MauiContext.cs:line 27
   at Microsoft.Maui.MauiContext.WrappedServiceProvider.GetService(Type serviceType) in Microsoft.Maui\MauiContext.cs:line 27
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) in /_/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/ServiceProviderServiceExtensions.cs:line 45
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) in /_/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/ServiceProviderServiceExtensions.cs:line 65
   at Microsoft.Maui.MauiWinUIApplication.OnLaunched(LaunchActivatedEventArgs args) in Microsoft.Maui\MauiWinUIApplication.cs:line 74
   at Microsoft.UI.Xaml.Application.Microsoft.UI.Xaml.IApplicationOverrides.OnLaunched(LaunchActivatedEventArgs args) in C:\__w\1\s\BuildOutput\obj\x86fre\src\projection\generated\Microsoft.UI.Xaml.cs:line 387
   at ABI.Microsoft.UI.Xaml.IApplicationOverrides.Do_Abi_OnLaunched_0(IntPtr thisPtr, IntPtr args) in C:\__w\1\s\BuildOutput\obj\x86fre\src\projection\generated\Microsoft.UI.Xaml.cs:line 13722

Steps to reproduce the bug

Code to reproduce

#if WINDOWS
        Microsoft.UI.Xaml.Application.Current.DebugSettings.LayoutCycleTracingLevel = LayoutCycleTracingLevel.High;
#endif

Expected behavior

It does not crash, and layout cycles are debuggable.

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.5.5: 1.5.240627000

Windows version

Windows 11 (22H2): Build 22621

Additional context

No response

@daltzctr daltzctr added the bug Something isn't working label Jul 17, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Jul 17, 2024
@codendone codendone added area-Layouts team-Controls Issue for the Controls team Crash whenever user reports a crash or app freeze and removed needs-triage Issue needs to be triaged by the area owners labels Jul 18, 2024
@codendone
Copy link
Contributor

I don't repro this issue. Is there anything special about your repro?

@kmahone kmahone added the needs-author-feedback Asked author to supply more information. label Jul 20, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Layouts bug Something isn't working Crash whenever user reports a crash or app freeze needs-author-feedback Asked author to supply more information. no-recent-activity team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests

3 participants