React-native-windows: C++ app/lib project templates use C# projects

Created on 8 Oct 2020  路  5Comments  路  Source: microsoft/react-native-windows

We should not require any C# components in C++ apps or modules by default.

Related: #5549
CC @jonthysell

Agenda bug needs dev design

Most helpful comment

I'd rather C# be a first class citizen and out of the box compatibility should not be opt-in.

While we're still building from source, if developers want to speed up their build, they can remove the projects if they really want to. Once we're on binaries, it won't matter.

In the meantime, it's not affecting their app runtime in any way.

All 5 comments

What do you mean? What is used?

If you're talking about the solution file, without any includes support the solution file MUST contain all of the projects that might be used by native modules. So in order for C++ apps to consume C# modules, they must be there.

right - this won't be the default case though so by default we should not have them in the solution.
A couple of options:

  • add an option to opt in at project creation time, or
  • add a script to opt in after the fact

I'd rather C# be a first class citizen and out of the box compatibility should not be opt-in.

While we're still building from source, if developers want to speed up their build, they can remove the projects if they really want to. Once we're on binaries, it won't matter.

In the meantime, it's not affecting their app runtime in any way.

We've had a lot of varied and strong opinions on this, seems like we should strike up a meeting and sort it out. We missed this Monday's slot so let's set up a one-off.

Discussion notes:

  • add logic to autolinking to detect the language the native module was written in (e.g. via the project extension, either vcxproj/csproj). Based on that:

    • if there is one or more C# module then add the property to the app's project to enable bringing in the .net native props/targets

    • add the Microsoft.ReactNative.Managed project to the solution

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chai41104 picture chai41104  路  3Comments

KristijanZic picture KristijanZic  路  3Comments

dubiao picture dubiao  路  3Comments

kikisaints picture kikisaints  路  4Comments

josephan picture josephan  路  3Comments