-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 use C# module from C++ on 0.63 #5825
Comments
Marking for 0.63 since we can scoop this into discussion. @asklar would you be able to add details? Relevant is whether this is a new regression. |
Added comments from the Teams thread. @jonthysell mentioned that this is because the cpp project doesn't include references to the microsoft.reactnative.managed.dll which I would expect we wouldn't by default (since you shouldn't need it if you only have C++ native modules), but we should have a documented way for you to consume C# modules from C++) |
I've figured it out, the reason SampleAppCPP works loading SampleLibraryCS - it imports ~40 .Net/UWP/.NetNative targets to make the scenario work, and none of that was added to the CLI template for other apps. Working on a fix. |
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 property `ConsumeCSharpModules`. 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
…5851) 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 property `ConsumeCSharpModules`. 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 microsoft#5825 Closes microsoft#4557
) 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 property `ConsumeCSharpModules`. 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
@qmatteoq ran into this when trying to update the GeolocationSample to 0.63
The text was updated successfully, but these errors were encountered: