You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/runtimes.md
+64Lines changed: 64 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,6 +103,68 @@ When enabled, the compiler:
103
103
- No AWF mounts or PATH prepends needed — `NodeTool@0` installs to `/opt/hostedtoolcache` (auto-mounted by AWF) and publishes PATH entries that AWF merges via `$GITHUB_PATH`
104
104
- Note: AWF overlays `~/.npmrc` with `/dev/null` for credential security — the `NPM_CONFIG_REGISTRY` env var approach avoids conflicting with this overlay
105
105
106
+
### .NET (`dotnet:`)
107
+
.NET runtime. Auto-installs the .NET SDK via `UseDotNet@2`, emits `NuGetAuthenticate@1` for internal feed access, adds .NET ecosystem domains to the AWF network allowlist, and extends the bash command allow-list with `dotnet`.
108
+
109
+
```yaml
110
+
# Simple enablement (installs default .NET SDK, currently 8.0.x)
111
+
runtimes:
112
+
dotnet: true
113
+
114
+
# With options (pin version, configure internal feed)
# Pin SDK from the repo's global.json (UseDotNet@2 useGlobalJson mode)
127
+
runtimes:
128
+
dotnet:
129
+
version: "global.json"
130
+
```
131
+
132
+
**Fields:**
133
+
134
+
| Field | Type | Description |
135
+
|-------|------|-------------|
136
+
| `version` | string | .NET SDK version to install (e.g., `"8.0.x"`, `"9.0.x"`). Passed to `UseDotNet@2` `version` with `packageType: 'sdk'`. Defaults to `"8.0.x"`. The special value `"global.json"` (case-insensitive) emits `useGlobalJson: true` instead, which discovers and installs every SDK referenced by `global.json` files in the workspace. |
137
+
| `feed-url` | string | Internal NuGet feed URL (typically the v3 `index.json` of an Azure Artifacts feed). When set, the compiler creates a minimal `nuget.config` if none exists and runs `NuGetAuthenticate@1`. |
138
+
| `config` | string | Path to a checked-in `nuget.config` in the repo. When set, the compiler runs `NuGetAuthenticate@1` (which auto-discovers `nuget.config` files in the workspace). Mutually exclusive with `feed-url`. |
139
+
140
+
**`global.json` precedence.** A `global.json` file in the repo is the canonical
141
+
way to pin the .NET SDK. The compiler enforces a single source of truth:
142
+
143
+
- If a `global.json` exists at the agent's compile directory **and** the front
144
+
matter sets a concrete `version`, compilation **errors out**. Either remove
145
+
the front-matter version or set it to the literal string `"global.json"` to
146
+
opt into `UseDotNet@2`'s `useGlobalJson: true` mode.
147
+
- If `version: "global.json"` is set, the compiler emits
148
+
`useGlobalJson: true` (no explicit `version:` input) so the install task
149
+
walks the workspace for `global.json` files itself.
150
+
- If no `version` is set and a `global.json` exists, the compiler does not
151
+
auto-promote — the default `"8.0.x"` is used. Opt in explicitly with the
152
+
sentinel.
153
+
154
+
When enabled, the compiler:
155
+
- Injects `UseDotNet@2` into `{{ prepare_steps }}` (runs before AWF)
156
+
- If `feed-url` is set, injects an ensure-`nuget.config` step (writes a minimal `nuget.config` referencing the feed only when one doesn't already exist) and `NuGetAuthenticate@1`
157
+
- If `config` is set (and `feed-url` is not), injects `NuGetAuthenticate@1` only — the user-checked-in `nuget.config` is assumed to be present in the workspace
158
+
- Auto-adds `dotnet` to the bash command allow-list
159
+
- Adds .NET ecosystem domains to the network allowlist (nuget.org, dotnet.microsoft.com, pkgs.dev.azure.com, etc.)
160
+
- Appends a prompt supplement informing the agent about .NET availability
161
+
- No AWF mounts or PATH prepends needed — `UseDotNet@2` installs to `/opt/hostedtoolcache` (auto-mounted by AWF) and publishes PATH entries that AWF merges via `$GITHUB_PATH`
162
+
163
+
**Differences from the Python and Node runtimes** (called out for clarity, since this runtime intentionally diverges):
164
+
- **No agent env var is injected for `feed-url`.** Unlike `pip` (`PIP_INDEX_URL`) and `npm` (`NPM_CONFIG_REGISTRY`), NuGet has no first-class environment-variable equivalent for selecting a package source. Feed configuration always goes through a `nuget.config` file.
165
+
- **`config:` is functional, not a deferred warning.** AWF only overlays files in `$HOME` (e.g., `~/.npmrc` → `/dev/null`); workspace files such as `nuget.config` are preserved inside the agent sandbox, so a checked-in `nuget.config` works today.
166
+
- **`NuGetAuthenticate@1` requires no `workingFile:` input.** It auto-discovers `nuget.config` files anywhere in the workspace, unlike `npmAuthenticate@0` which needs an explicit path.
0 commit comments