microsoft / microsoft/react-native-windows

0.73.4 C# Template app crashes when option "--experimentalNuGetDependency true" is used

Open
#12,690 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug Recent Regression Scenario: NuGet Workstream: New Arch NuGet Refactor
Dominant language
C++
Stars
17.3k
Forks
1.2k
Avg merge
1d 13h
Merged PRs (30d)
33

Description

Problem Description

I initialized a new React Native Windows App using C# and the react-native-windows NuGet packages in order to minimize the build time. The application builds without any issue but crashes after a couple of seconds. The exception is the following:

Exception thrown at 0x0000000000000000 in CSAppNuget.exe: 0xC0000005: Access violation executing location 

And the call stack:

Microsoft.ReactNative.dll!Microsoft::ReactNative::`anonymous namespace'::initHermesApi() Line 55 at D:\a\_work\1\s\vnext\Shared\HermesRuntimeHolder.cpp(55)

On output window I get this:

ERROR: Native images generated against multiple versions of assembly Microsoft.UI.Xaml. Exception thrown at 0x00007FF99948CF19 in CSAppNuget.exe: Microsoft C++ exception: EEMessageException at memory location 0x000000B4E82FA030.

Should I try using Chakra instead of Hermes?
I also tried initializing the app without the --experimentalNuGetDependency true option and it runs normally.

Steps To Reproduce

1.npx react-native init CSAppNuget --version latest
2.cd CSAppNuget
3.npx react-native-windows-init --language cs --experimentalNuGetDependency true --version 0.73.4 --overwrite
4.yarn windows

Expected Results

No response

CLI version

12.3.2

Environment
System:
  OS: Windows 10 10.0.19045
  CPU: (2) x64 Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
  Memory: 3.59 GB / 10.28 GB
Binaries:
  Node:
    version: 18.12.1
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.21
    path: C:\Program Files\nodejs\yarn.CMD
  npm:
    version: 8.19.2
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    AllowAllTrustedApps: Enabled
    Versions:
      - 10.0.17763.0
      - 10.0.18362.0
      - 10.0.19041.0
      - 10.0.22621.0
IDEs:
  Android Studio: AI-231.9392.1.2311.11076708
  Visual Studio:
    - 17.8.34511.84 (Visual Studio Community 2022)
    - 16.11.31829.152 (Visual Studio Professional 2019)
Languages:
  Java:
    version: 11.0.2
    path: C:\Users\user\AppData\Local\jdk-11.0.2\bin\javac.EXE
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.4
    wanted: ^0.73.4
  react-native-windows:
    installed: 0.73.4
    wanted: 0.73.4
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found
Target Platform Version

10.0.19041

Target Device(s)

Desktop

Visual Studio Version

Visual Studio 2022

Build Configuration

Debug

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.

Research direction

Start by reproducing the crash with the listed react-native-windows-init and yarn windows commands. Inspect vnext/Shared/HermesRuntimeHolder.cpp at line 55, then investigate the Microsoft.UI.Xaml multiple-version error produced when --experimentalNuGetDependency true is used. Done means the C# template builds and runs without the access violation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, csharp, react
Domain
build-system, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.