Open 0x4741 opened 1 month ago
Can you help us find the breaking point in your example? I could only find this: https://github.com/0x4741/-ReactNativeWindows-UnsafeBug/blob/d7dfb5886f4a5dca5823538622a1c5f75e702974/windows/NativeModuleSample/DataMarshallingExamples.cs#L207 Which isn't an attributed method, so I wouldn't expect it to hit by the RN native modules. Or are you saying just by having any unsafe code in there, it fails?
Is there more to the build log than the snippet you provided above that might be helpful?
Out of curiosity, where are you planning on using unsafe code in your C# module?
Yes, having any unsafe code, even if it is not used, causes it to fail. I am planning to use unsafe code in some native modules needed for a DLL.
Problem Description
Using any unsafe code in native modules causes the project to fail when running in a debug configuration
Steps To Reproduce
Expected Results
No response
CLI version
13.6.9
Environment
Community Modules
@react-native-community/cli
Target Platform Version
None
Target Device(s)
Desktop
Visual Studio Version
Visual Studio 2022
Build Configuration
Debug
Snack, code example, screenshot, or link to a repository
Here is an example from React-native-windows-samples that uses NativeModuleSample. Same result on both Windows 10 and 11.
Message when using --logging:
"C:\Users\User\Documents\AwesomeProject\node_modules\react-native-windows\target\x64\Debug\Microsoft.ReactNative.Managed.CodeGen\publish\Microsoft.ReactNative.Managed.CodeGen.exe
@C\Users\User\Documents\AwesomeProject\windows\AwesomeProject\obj\x64\Debug\awesomeproject.ReactNativeCodeGenawesomeproject.ReactNativeCodeGen.rsp" exited with code 1.