CI failure on 10.0 on Windows: Unable to load DLL 'nativelibrary' in R2R tests
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Description
## Build Information
Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1595328
Build error leg or test failing: readytorun/tests/mainv1/mainv1.cmd
Pull request: https://github.com/dotnet/runtime/pull/133851
## Error Message
**DO NOT USE JSON BELOW IF THIS IS A BUILD BREAK** otherwise build analysis will allow pull requests to merge that break the build worse. For a build break, do not use this issue form. Make a regular new issue.
Fill the error message using [step by step known issues guidance](https://github.com/dotnet/arcade/blob/main/Documentation/Build%20Analysis/KnownIssueJsonStepByStep.md).
```json
{
"ErrorMessage": [
"Running test: readytorun/tests",
"System.DllNotFoundException: Unable to load DLL 'nativelibrary' or one of its dependencies: The specified module could not be found."],
"BuildRetry": false,
"ExcludeConsoleLog": false
}
```
```
10:59:47.689 Running test: readytorun/tests/mainv1/mainv1.cmd
Unhandled exception. System.DllNotFoundException: Unable to load DLL 'nativelibrary' or one of its dependencies: The specified module could not be found. (0x8007007E)
at MyClass.NativeMethod()
at Program.RunAllTests()
at Program.Main()
Return code: 1
Raw output file: C:\h\w\A4E008E5\w\A6E50938\uploads\tests\mainv1\output.txt
Raw output:
BEGIN EXECUTION
1 file(s) copied.
1 file(s) copied.
Emitting R2R PE file: test.dll
Emitting map file: test.map
Emitting R2R PE file: fieldgetter.dll
Emitting map file: fieldgetter.map
Emitting R2R PE file: mainv1.dll
Emitting map file: mainv1.map
"C:\h\w\A4E008E5\p\corerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false" -p "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true" mainv1.dll
TestVirtualMethodCalls
TestMovedVirtualMethod
TestThrowHelpers
TestConstrainedMethodCalls
TestConstrainedMethodCalls_Unsupported
TestInterop
Expected: 100
Actual: -532462766
END EXECUTION - FAILED
FAILED
Test failed. Trying to see if dump file was created in C:\cores since 9/14/2026 10:59:47 AM
Processing C:\cores\corerun.exe.8572.dmp
Unable to find cdb.exe at C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\cdb.exe
Test Harness Exitcode is : 1
To run the test:
Set up CORE_ROOT and run.
> C:\h\w\A4E008E5\w\A6E50938\e\readytorun\readytorun\../tests/mainv1/mainv1.cmd
Xunit.Sdk.TrueException: Unhandled exception. System.DllNotFoundException: Unable to load DLL 'nativelibrary' or one of its dependencies: The specified module could not be found. (0x8007007E)
at MyClass.NativeMethod()
at Program.RunAllTests()
at Program.Main()
Return code: 1
Raw output file: C:\h\w\A4E008E5\w\A6E50938\uploads\tests\mainv1\output.txt
Raw output:
BEGIN EXECUTION
1 file(s) copied.
1 file(s) copied.
Emitting R2R PE file: test.dll
Emitting map file: test.map
Emitting R2R PE file: fieldgetter.dll
Emitting map file: fieldgetter.map
Emitting R2R PE file: mainv1.dll
Emitting map file: mainv1.map
"C:\h\w\A4E008E5\p\corerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false" -p "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true" mainv1.dll
TestVirtualMethodCalls
TestMovedVirtualMethod
TestThrowHelpers
TestConstrainedMethodCalls
TestConstrainedMethodCalls_Unsupported
TestInterop
Expected: 100
Actual: -532462766
END EXECUTION - FAILED
FAILED
Test failed. Trying to see if dump file was created in C:\cores since 9/14/2026 10:59:47 AM
Processing C:\cores\corerun.exe.8572.dmp
Unable to find cdb.exe at C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\cdb.exe
Test Harness Exitcode is : 1
To run the test:
Set up CORE_ROOT and run.
> C:\h\w\A4E008E5\w\A6E50938\e\readytorun\readytorun\../tests/mainv1/mainv1.cmd
at Xunit.Assert.True(Nullable`1 condition, String userMessage) in /_/src/arcade/src/Microsoft.DotNet.XUnitAssert/src/BooleanAsserts.cs:line 141
at Program.<$>g__TestExecutor19|0_20(StreamWriter tempLogSw, StreamWriter statsCsvSw, <>c__DisplayClass0_0&)
10:59:56.160 Failed test: readytorun/tests/mainv1/mainv1.cmd
10:59:56.165 Running test: readytorun/tests/mainv2/mainv2.cmd
Unhandled exception. System.DllNotFoundException: Unable to load DLL 'nativelibrary' or one of its dependencies: The specified module could not be found. (0x8007007E)
at MyClass.NativeMethod()
at Program.RunAllTests()
at Program.Main()
Return code: 1
Raw output file: C:\h\w\A4E008E5\w\A6E50938\uploads\tests\mainv2\output.txt
Raw output:
BEGIN EXECUTION
1 file(s) copied.
1 file(s) copied.
Emitting R2R PE file: test.dll
Emitting map file: test.map
Emitting R2R PE file: fieldgetter.dll
Emitting map file: fieldgetter.map
Emitting R2R PE file: mainv2.dll
Emitting map file: mainv2.map
"C:\h\w\A4E008E5\p\corerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false" -p "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true" mainv2.dll
TestVirtualMethodCalls
TestMovedVirtualMethod
TestThrowHelpers
TestConstrainedMethodCalls
TestConstrainedMethodCalls_Unsupported
TestInterop
Expected: 100
Actual: -532462766
END EXECUTION - FAILED
FAILED
Test failed. Trying to see if dump file was created in C:\cores since 9/14/2026 10:59:56 AM
Processing C:\cores\corerun.exe.5832.dmp
Unable to find cdb.exe at C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\cdb.exe
Finished looking for *.dmp. No new files created.
Test Harness Exitcode is : 1
To run the test:
Set up CORE_ROOT and run.
> C:\h\w\A4E008E5\w\A6E50938\e\readytorun\readytorun\../tests/mainv2/mainv2.cmd
Xunit.Sdk.TrueException: Unhandled exception. System.DllNotFoundException: Unable to load DLL 'nativelibrary' or one of its dependencies: The specified module could not be found. (0x8007007E)
at MyClass.NativeMethod()
at Program.RunAllTests()
at Program.Main()
Return code: 1
Raw output file: C:\h\w\A4E008E5\w\A6E50938\uploads\tests\mainv2\output.txt
Raw output:
BEGIN EXECUTION
1 file(s) copied.
1 file(s) copied.
Emitting R2R PE file: test.dll
Emitting map file: test.map
Emitting R2R PE file: fieldgetter.dll
Emitting map file: fieldgetter.map
Emitting R2R PE file: mainv2.dll
Emitting map file: mainv2.map
"C:\h\w\A4E008E5\p\corerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false" -p "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true" mainv2.dll
TestVirtualMethodCalls
TestMovedVirtualMethod
TestThrowHelpers
TestConstrainedMethodCalls
TestConstrainedMethodCalls_Unsupported
TestInterop
Expected: 100
Actual: -532462766
END EXECUTION - FAILED
FAILED
Test failed. Trying to see if dump file was created in C:\cores since 9/14/2026 10:59:56 AM
Processing C:\cores\corerun.exe.5832.dmp
Unable to find cdb.exe at C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64\cdb.exe
Finished looking for *.dmp. No new files created.
Test Harness Exitcode is : 1
To run the test:
Set up CORE_ROOT and run.
> C:\h\w\A4E008E5\w\A6E50938\e\readytorun\readytorun\../tests/mainv2/mainv2.cmd
at Xunit.Assert.True(Nullable`1 condition, String userMessage) in /_/src/arcade/src/Microsoft.DotNet.XUnitAssert/src/BooleanAsserts.cs:line 141
at Program.<$>g__TestExecutor20|0_21(StreamWriter tempLogSw, StreamWriter statsCsvSw, <>c__DisplayClass0_0&)
11:00:00.597 Failed test: readytorun/tests/mainv2/mainv2.cmd
```
### Known issue validation
**Build: :mag_right:** https://dev.azure.com/dnceng-public/public/_build/results?buildId=1595328
**Error message validated:** `[Running test: readytorun/tests System.DllNotFoundException: Unable to load DLL 'nativelibrary' or one of its dependencies: The specified module could not be found.`]
**Result validation:** :white_check_mark: Known issue matched with the provided build.
**Validation performed at:** 9/14/2026 3:57:57 PM UTC
### Report
|Build|Repository|Test|Pull Request|
|---|---|---|---|
|[1595328](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1595328)|dotnet/runtime|[readytorun/tests/mainv1/mainv1.cmd](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1595328&view=ms.vss-test-web.build-test-results-tab&runId=44047924&resultId=104761)|dotnet/runtime#133851|
#### Summary
|24-Hour Hit Count|7-Day Hit Count|1-Month Count|
|---|---|---|
|0|1|1|
Contributor guide
Research direction
Start with readytorun/tests/mainv1/mainv1.cmd and mainv2/mainv2.cmd, using the linked build and CORE_ROOT instructions to reproduce the Windows failure. Trace the nativelibrary load reported by MyClass.NativeMethod and confirm both tests complete with the expected result of 100; the issue already references pull request #133851.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- compilers, operating-systems, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100