-
Notifications
You must be signed in to change notification settings - Fork 409
Closed
microsoft/devhome
#3437Description
Describe the bug
Replace the default settings in Registry at HKEY_CLASSES_ROOT\Folder\shell\opennewwindow\command to activate the application though press Win + E.
However, app that use Windows App Sdk could not be activated at this situation. TypeInitializationException was threw in AppInstance.GetCurrent(), message: 0x80040154 (REGDB_E_CLASSNOTREG).
Just to mention that activate the application though command line will not raise any exception.
at WinRT.ActivationFactory`1.As(Guid iid)
at Microsoft.Windows.AppLifecycle.AppInstance.Make___objRef_global__Microsoft_Windows_AppLifecycle_IAppInstanceStatics()
at Microsoft.Windows.AppLifecycle.AppInstance.get__objRef_global__Microsoft_Windows_AppLifecycle_IAppInstanceStatics()
at Microsoft.Windows.AppLifecycle.AppInstance.GetCurrent()
at CommandLineTest.Program.Main(String[] args)
at C:\Users\zrfcfgs\source\repos\CommandLineTest\CommandLineTest\Program.cs : Line 46
Steps to reproduce the bug
- Download demo application
- Run the demo application and click "Click to Register" button
- Elevated requested just approve it (if UAC enabled)
- Related data was written into registry
- Close the application and press Win + E to activate the application
- Visual Studio was requested to debug
- See the exception
- Don't forget to click "Click to Unregister" to restore the registry after investigation
Expected behavior
AppInstance.GetCurrent() should not threw any exception
Screenshots
No response
NuGet package version
Windows App SDK 1.2.3: 1.2.230118.102
Packaging type
Packaged (MSIX)
Windows version
Windows 11 version 22H2 (22621, 2022 Update)
IDE
Visual Studio 2022
Additional context
Demo application is in here:
CommandLineTest.zip
Metadata
Metadata
Assignees
Labels
No labels