Skip to content

Commit

Permalink
Update contributing with BuildNet9 info
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAngryByrd committed Nov 16, 2024
1 parent 51c822d commit 7f9b53d
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,30 @@

1. Clone repo.
2. Install local tools with `dotnet tool restore`

## Testing

Testing against different .NET runtimes is a bit of a chore because we want to let the runtime load the current runtime's Microsoft.Build assemblies. Unfortunately, we can't have the `global.json` set to `net9.0` because the `Microsoft.Build` assemblies are compatible with the .NET 9 runtime, and will try to load them, even in a net8.0 TFM context. (Chet to fill in longer description as to why.)

### Against LTS (net8.0)
1. Run tests with `dotnet run --project .\build\ -- -t Test`
1. This should chose the `Test:net9.0` target and run against that runtime


### Against STS (net9.0)
1. Change global.json to use net9.0
```json
"sdk": {
"version": "9.0.100",
"rollForward": "latestMinor",
"allowPrerelease": true
}
```
2. Set environment variable `BuildNet9` to `true`
1. Bash: `export BuildNet9=true`
2. PowerShell: `$env:BuildNet9 = "true"`
3. Run tests with `dotnet run --project .\build\ -- -t Test`
4. Create packages with `dotnet run --project .\build\ -- -t Pack`
1. This should chose the `Test:net9.0` target and run against that runtime

## Release

Expand Down

0 comments on commit 7f9b53d

Please sign in to comment.