microsoft / microsoft/react-native-windows

RNW 0.68 run-windows fails nuget restore when project depends on C# Native Modules

Open
#10,059 13 comments 0 reactions 1 assignee View on GitHub

@JunielKatarn is already working on this.

Since Jun 6, 2022.

Area: CLI Area: Native Modules bug PackageReference Workstream: Module Support
Dominant language
C++
Stars
17.3k
Forks
1.2k
Avg merge
1d 13h
Merged PRs (30d)
33

Description

Problem Description

Hi,

I am trying to add a Native Module in C# to my project, but give the error:
Project ReactNativeFileViewer is not compatible with native (native,Version=v0.0). Project ReactNativeFileViewer supports: uap10.0.16299 (UAP,Version=v10.0.16299)

Steps To Reproduce

1 . First create the native module with like in documentation: https://microsoft.github.io/react-native-windows/docs/native-modules-setup

  • The last command i run is: npx react-native-windows-init --version latest --projectType lib --language cs --overwrite
  • In native module versions are:
    • react --> 17.0.2
    • react-native --> 0.68.2
    • react-native-windows --> 0.68.4

2 - Create new Project like in documentation: https://microsoft.github.io/react-native-windows/docs/getting-started

  • The versions in package.json is:
    • react --> 17.0.2
    • react-native --> 0.68.2
    • react-native-windows --> 0.68.4

3 - Add the native module to package.json of project
4 - npm i to install module
5 - Autolink the native module
6 - Run in VS x86

Expected Results

No response

CLI version

npx react-native --version

Environment
npx react-native info
Target Platform Version

No response

Target Device(s)

No response

Visual Studio Version

2019

Build Configuration

No response

Snack, code example, screenshot, or link to a repository

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.