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

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

Closed
taooceros opened this issue Dec 5, 2020 · 2 comments
Labels
area-Interop-coreclr untriaged New issue has not been triaged by the area owner

Comments

@taooceros
Copy link

taooceros commented Dec 5, 2020

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

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-Interop-coreclr untriaged New issue has not been triaged by the area owner labels Dec 5, 2020
@AaronRobinsonMSFT
Copy link
Member

WinRT support is now entirely provided by the C#/WinRT tool chain. The above issue appears to be an problem with usage of the generated API by C#/WinRT. The recommendation is to post issues for WinRT at https://github.com/microsoft/CsWinRT.

See #37672

@taooceros
Copy link
Author

WinRT support is now entirely provided by the C#/WinRT tool chain. The above issue appears to be an problem with usage of the generated API by C#/WinRT. The recommendation is to post issues for WinRT at https://github.com/microsoft/CsWinRT.

See #37672

Thank you for pointing that out. I will port it to that.

@ghost ghost locked as resolved and limited conversation to collaborators Jan 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Interop-coreclr untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

3 participants