Skip to content

Expect NativeAOT lib prefix on Unix for .NET 11 SDK - #2835

Open
baronfel wants to merge 3 commits into
dotnet:mainfrom
baronfel:fix-nativeaot-lib-prefix
Open

Expect NativeAOT lib prefix on Unix for .NET 11 SDK#2835
baronfel wants to merge 3 commits into
dotnet:mainfrom
baronfel:fix-nativeaot-lib-prefix

Conversation

@baronfel

@baronfel baronfel commented Jul 8, 2026

Copy link
Copy Markdown
Member

Follow-up to #2820, addressing @akoeplinger's review feedback.

Starting with the .NET 11 SDK, NativeAOT applies the lib prefix by default to native library outputs on Unix (dotnet/docs#52324). This repo pins an 11.x SDK via global.json, so the published shared library is libNativeLibrary.so / libNativeLibrary.dylib. The CompilationTests helper still looked for NativeLibrary.so / .dylib, which would fail File.Exists on Linux/macOS CI.

This updates the expected native library filename to include the lib prefix on Unix.

Starting with the .NET 11 SDK, NativeAOT applies the \lib\ prefix by
default to native library outputs on Unix (dotnet/docs#52324). This repo
pins an 11.x SDK via global.json, so the published shared library is
libNativeLibrary.so / libNativeLibrary.dylib. Update the test's expected
filename accordingly so the file is found on Linux/macOS CI.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@baronfel
baronfel enabled auto-merge July 8, 2026 14:39
@akoeplinger

akoeplinger commented Aug 14, 2026

Copy link
Copy Markdown
Member

@baronfel this failed because the library project still targeted NetMinimum which is net10.0 currently so we still got the old behavior. added an opt-in property so this has the new behavior.

@baronfel

Copy link
Copy Markdown
Member Author

I can't approve so we need to get another reviewer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants