Skip to content

WinRT bug: System.InvalidOperationException:“Attempt to update previously set global instance.” #45632

@taooceros

Description

@taooceros

Description

When calling the new PackageManager(), this error throw.

Configuration

Using .Net 5 with TargetFramework net5.0-windows10.0.19041.0.
The windows OS version is 20H2 x64.

Regression?

Not sure, but .net core 3.1 with the Windows.SDK.Contract works well.

Other information

StackTrace

   at System.Runtime.InteropServices.ComWrappers.RegisterForTrackerSupport(ComWrappers instance)
   at WinRT.ComWrappersSupport.get_ComWrappers()
   at WinRT.ComWrappersSupport.TryRegisterObjectForInterface(Object obj, IntPtr thisPtr)
   at WinRT.ComWrappersSupport.RegisterObjectForInterface(Object obj, IntPtr thisPtr)
   at Windows.Management.Deployment.PackageManager..ctor()
   at Flow.Launcher.Plugin.Program.Programs.UWP.CurrentUserPackages() in D:\Document\Dotnet\Flow.Launcher\Plugins\Flow.Launcher.Plugin.Program\Programs\UWP.cs:line 200
   at Flow.Launcher.Plugin.Program.Programs.UWP.All() in D:\Document\Dotnet\Flow.Launcher\Plugins\Flow.Launcher.Plugin.Program\Programs\UWP.cs:line 156

Similar bug

microsoft/CsWinRT#394

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions