Source: CONTRIBUTING.md - Building and Testing
- .NET SDK: 10.0.100 (see
global.json) - Runtime: .NET 10.x (latest GA)
- Optional: ReSharper/Rider for code formatting (honor
.editorconfigandTerminal.sln.DotSettings)
Time: ~15-20 seconds
dotnet restoreMust run before building. Downloads all NuGet dependencies.
Time: ~50 seconds
dotnet build --configuration Debug --no-restoreExpected output:
- ~326 warnings (nullable reference warnings, unused variables, etc.) - these are normal
- 0 errors expected
dotnet build --configuration Release --no-restoreTime: ~10 min timeout
dotnet test --project Tests/UnitTests.NonParallelizable --no-build --verbosity normal- Uses
Application.Initand static state - Cannot run in parallel
- Includes
--diagnosticflag for logging
Time: ~10 min timeout
dotnet test --project Tests/UnitTestsParallelizable --no-build --verbosity normal- No dependencies on static state
- Preferred for new tests
- Faster execution
dotnet test --project Tests/IntegrationTests --no-build --verbosity normaldotnet test --project Tests/UnitTestsParallelizable --no-build --verbosity normal && dotnet test --project Tests/UnitTests.NonParallelizable --no-build --verbosity normalSolution: Build and publish the in-repo AOT smoke app:
dotnet publish ./Tests/NativeAotSmoke/NativeAotSmoke.csproj --configuration Release --output ./aot-publish
./aot-publish/NativeAotSmoke --smoke-testFor clean builds, always run in this order:
dotnet restore && dotnet build --no-restore && dotnet test --project Tests/UnitTestsParallelizable --no-build && dotnet test --project Tests/UnitTests.NonParallelizable --no-buildThis ensures:
- Packages are downloaded first
- Build uses restored packages
- Tests run against built assemblies
- Minimal rebuild overhead
- Any file modified in a PR that currently generates warnings MUST be fixed to remove those warnings
- Exception: Warnings caused by
[Obsolete]attributes can remain - Action: Before submitting a PR, verify your changes don't add new warnings and fix any warnings in files you modify