microsoft / microsoft/react-native-windows
Experimental nuget needs autolink-windows when app consumes library #csharp
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 17.3k
- Forks
- 1.2k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 33
Description
Problem Description
Hello everybody,
I work on an RNW v0.70.19 project where I have a csharp app that consumes a lot of csharp and cpp libraries, all in RNW as well. Recently I'm trying to use the experimental nuget to improve the build performance of my solution, but I've been having some problems making use of the experimental nuget in my project.
I had a lot of errors in my project, so I decided to test it in a new app to find out if my project's architecture is compatible with the RNW standard.
How I did an PoC of experimental nuget:
- I created a new app in csharp, because the app in my project is csharp.
- Also created two libraries, one in scharp and the other in cpp. Added both as dependencies in my app, installed and did autolink.
- I noticed the csharp library references Microsoft.ReactNative.Managed and Microsoft.ReactNative.Managed.CodeGen locally (from node_modules) projects, and even includes them within the solution.
- Then I removed manually this two projects of my solution and try to build again, but as these projects were added by autolink, I got autolink error.
NOTE: If I added just cpp library, the solution build corretly. So I believe that the error is only in the csharp library.
Steps To Reproduce
- Clone https://github.com/caiovictor/rnw-070-experimental-nuget
- Open app solution ./myApp/windows/myApp.sln on VS and build.
- Get autolink error.
Expected Results
The solution (app + library) is expected to build correctly.
CLI version
9.3.4
Environment
react v18.1.0
react-native v0.70.10
react-native-windows v0.70.19
Target Platform Version
10.0.19041
Target Device(s)
Desktop
Visual Studio Version
Visual Studio 2019
Build Configuration
Debug
Snack, code example, screenshot, or link to a repository
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Clone the linked PoC repository, open ./myApp/windows/myApp.sln in Visual Studio, and reproduce the autolink error while building. Compare the C# library setup with the working C++-only case and trace how the experimental NuGet projects are added by autolink; done means the app and library solution builds successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, csharp, react-native
- Domain
- build-system, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100