A compatibility issue occurs when using Fiber Local Storage (FLS) with .NET 9.0.5 and later on Windows x64 platforms. The same code works correctly in .NET 9.0.4 and earlier versions (include .NET 8.0, .NET 7.0, .NET 6.0, .NET Framework 4.5, etc.)
- Clone the repository:
git clone [email protected]:stdcion/win-fls-net9-bug.git
- Build the project in Release (or Debug, it doesn't matter):
cd win-fls-net9-bug
dotnet build --configuration Release
- Run the application with different .NET versions:
cd win-fls-net9-bug\bin\Release\net9.0\
dotnet --fx-version 9.0.4 .\win-fls-net9-bug.dll # works correctly
dotnet --fx-version 9.0.5 .\win-fls-net9-bug.dll # fails