[0.63] Fixed templates so C++ apps can consume C# native modules #5859
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change backports #5851 to 0.63
Original PR:
Right now C++/WinRT apps have a hard time consuming C# WinRT libraries from source. We fixed this in our SampleAppCpp in order to load SampleLibraryCS, but those fixes were not put into the template for the benefit of all apps.
This PR moves the fix into new
CppAppConsumeCSharpModule.(props|targets)
files. Since the fix involves importing a ton of other props/targets, and we don't want to risk breaking existing C++ apps who have no need of consuming C#-based native modules, the changes are behind a new propertyConsumeCSharpModules
.So if you have a C++/WinRT RNW app (the default) and need to consume C# native module, you can set
<ConsumeCSharpModules>true</ConsumeCSharpModules>
in your app project.This PR also fixes up the template solution files to include the projects they were missing.
Closes #5825
Closes #4557
Microsoft Reviewers: Open in CodeFlow