Skip to content
Draft
9 changes: 7 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@
}
},
"remoteEnv": {
"TARGET": "net9.0"
"TARGET": "net9.0",
"DOTNET_ROOT": "${containerWorkspaceFolder}/.dotnet",
"PATH": "${containerWorkspaceFolder}/.dotnet:${containerEnv:PATH}"
},
"postCreateCommand": [ "dotnet", "build", "FSharp.Compiler.Service.sln"]
"postCreateCommand": [
"bash", "-c",
"./eng/common/dotnet.sh && dotnet build FSharp.Compiler.Service.sln"
]
}
43 changes: 43 additions & 0 deletions DEVGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,49 @@ Running tests:

You can then open `FSharp.sln` in your editor of choice.

## Working with non-released .NET SDKs

This repository may require a non-released version of the .NET SDK, as specified in the `global.json` file. When the required SDK version is not publicly available through normal channels, you may encounter an error when running `dotnet build` directly:

```
The .NET SDK could not be found, please run ./eng/common/dotnet.sh.
```

### Setting up the correct SDK

Before using plain `dotnet build` commands, you need to install the required SDK version locally:

**On Linux/macOS:**
```shell
./eng/common/dotnet.sh
```

**On Windows:**
```shell
.\eng\common\dotnet.cmd
```

This downloads and installs the correct SDK version to a local `.dotnet` directory in the repository root.

### Using dotnet commands with the local SDK

After running the setup script once to install the SDK, you can use regular `dotnet` commands normally:

1. **One-time SDK installation**:
```shell
# Linux/macOS
./eng/common/dotnet.sh

# Windows
.\eng\common\dotnet.cmd
```

2. **Regular dotnet commands** (after SDK installation):
```shell
dotnet build FSharp.Compiler.Service.sln
dotnet test tests/FSharp.Compiler.Service.Tests/
```

## Testing from the command line

You can find all test options as separate flags. For example `build -testAll`:
Expand Down
Loading