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

Can't make a C++ app with C++/CLI dependency self contained #44305

Open
dryms35 opened this issue Oct 18, 2024 · 0 comments
Open

Can't make a C++ app with C++/CLI dependency self contained #44305

dryms35 opened this issue Oct 18, 2024 · 0 comments
Labels
Area-NetSDK untriaged Request triage from a team member

Comments

@dryms35
Copy link

dryms35 commented Oct 18, 2024

I am using a Windows App Packaging Project to package a C++ MFC app that references a C++/CLI MFC dll extension project. The WAP project is used to create an MSIX package that can be side-loaded and eventually will be used to upload to the Microsoft Store. The issue I am running into is that the packaged app will crash when calling .NET code from the MFC extension dll if the .NET 8 Runtime is not installed. All I get from the event viewer is

Faulting module name: ucrtbase.dll, version: 10.0.26100.1882, time stamp: 0xf79ede89

Since the WAP project is referencing a C++ project, it adds the Microsoft VCLibs Desktop dependency, meaning the packaged app has the required MFC dlls to run self contained. When I build a WAP project that references a .NET project as it’s entry point, it adds all the necessary dll’s to make it self contained and not require the .NET runtime to be installed.

I have tried making the C++/CLI project self contained, and have tried adding a self contained C# project to the solution just to get the .NET dependencies, but no luck.

How do I get a WAP project that references a C++ project that uses C++/CLI to include both the VCLibs dependencies as well as the .NET dependencies so the package app can be fully self contained?

I created a test project to demonstrate. https://github.com/dryms35/TestApp

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-NetSDK untriaged Request triage from a team member labels Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-NetSDK untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

1 participant