WindowsAppSDK
WindowsAppSDK copied to clipboard
Crash when run as administrator for packaged app
Describe the bug
My App is a packages App, in the main code I called FindOrRegisterForKey to achieve singleton. however, the Class not registered excpetion happened when I run the App as Administrator... run as user works just fine.
OSVer: Windows 10.0.18363.418 AppSDKversion: Microsoft.WindowsAppRuntime.1.1_1004.584.2120.0_x86__8wekyb3d8bbwe
StackTrace:
CoreCLR Version: 6.0.722.32202 .NET Version: 6.0.7 Description: The process was terminated due to an unhandled exception. Exception Info: System.TypeInitializationException: The type initializer for 'WinRT.ActivationFactory
1' threw an exception. ---> System.Runtime.InteropServices.COMException (0x80040154): Class not registered (0x80040154 (REGDB_E_CLASSNOTREG)) at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode) at WinRT.BaseActivationFactory..ctor(String typeNamespace, String typeFullName) at WinRT.ActivationFactory
1..ctor() at WinRT.ActivationFactory`1..cctor() --- End of inner exception stack trace --- 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.FindOrRegisterForKey(String key) at LenovoVantage.Program.Main(String[] args)
Steps to reproduce the bug
just launch... the app.
Expected behavior
launch normally.
Screenshots
No response
NuGet package version
1.1.4
Packaging type
Packaged (MSIX)
Windows version
Windows 10 version 1909 (18363, November 2019 Update)
IDE
Visual Studio 2022
Additional context
No response