Skip to content

Referencing any C++/WinRT package from a C#/WinRT project causes "Failed to create CoreCLR" error #1336

@Psychlist1972

Description

@Psychlist1972

Describe the bug
No idea where the fault lies here, or where to look. It could be C++/WinRT, it could be C#/WinRT, or my code.

Simply referencing another C++/WinRT projection project from my .NET app is causing the app to immediately terminate with this error:

Failed to create CoreCLR, HRESULT: 0x80070057
The thread '.NET EventPipe' (0xa89c) has exited with code 2147516553 (0x80008089).

I never use anything in the lib. It's the presence of the reference which causes that. If I remove the NuGet package (which contains a C++/WinRT winmd and dll, and a C#/WinRT projection assembly), the project runs fine. No code changes.

Originally I thought there was some complexity in my library, but the same thing happens with a very simple project with two WinRT classes with no actual functionality.

I tried in my complex application, which is a packaged full trust app and uses WinUI. Note, that WinUI itself doesn't cause issues in the .NET apps, so again, not sure where to look for the issue here.

To see if it was the app at fault, I created a blank C#/WinRT console app, with nothing more than "hello world" and the same issue happens.

Tried with .NET 7 and .NET 8. Currently using the .NET 8 SDK, but targeting .NET 7.
net7.0-windows10.0.22621.0
10.0.20348.0

I was tried rolling back to the .NET 7 SDK in case this was something in .NET 8's SDK, but I was unsuccessful doing that without seemingly having to repave all my dev tools. I wasn't keen on doing that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions