Skip to content

Commit 2b926e8

Browse files
Apply suggestions from code review
Co-authored-by: Elinor Fung <elfung@microsoft.com>
1 parent ee9093f commit 2b926e8

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

proposed/local-sdk-global-json.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,17 @@ the default error message.
2929

3030
There is currently a disconnect between the ways the .NET SDK is deployed in
3131
practice and what the host resolver can discover when searching for compatible
32-
SDKs. By default the host resolver is only going to search for SDKs in machine
33-
wide locations: `C:\Program Files\dotnet`, `%PATH%`, etc ... The .NET SDK
32+
SDKs. By default the host resolver is only going to search for SDKs next to
33+
the running `dotnet`. This often means machine-wide locations, since users
34+
and tools typically rely on `dotnet` already being on the user's path when
35+
launching, instead of specifying a full path to the executable. The .NET SDK
3436
though is commonly deployed to local locations: `%LocalAppData%\Microsoft\dotnet`,
3537
`$HOME/.dotnet`. Many repos embrace this and restore the correct .NET for their
3638
builds into a local `.dotnet` directory.
3739

3840
The behavior of the host resolver is incompatible with local based deployments.
3941
It will not find these deployments without additional environment variable
40-
configuration and instead search in machine wide locations. That means tools
42+
configuration and only search next to the running `dotnet`. That means tools
4143
like Visual Studio and VS Code simply do not work with local deployment by
4244
default. Developers must take additional steps like manipulating `%PATH%` before
4345
launching these editors. That reduces the usefulness of items like the quick
@@ -137,8 +139,8 @@ hence discovery stops there.
137139
This design requires us to only change the host resolver. That means other
138140
tooling like Visual Studio, VS Code, MSBuild, etc ... would transparently
139141
benefit from this change. Repositories could update global.json to have
140-
`additionalPaths` support `.dotnet` and Visual Studio would automatically find
141-
it without any design changes.
142+
`paths` support `.dotnet` and Visual Studio would automatically find it without
143+
any design changes.
142144

143145
## Considerations
144146

@@ -175,8 +177,8 @@ all location and choosing the best match.
175177

176178
Best match is a valid approach though. Can certainly see the argument for some
177179
customers wanting that. Feel like it cuts against the proposal a bit because it
178-
devalues `additionalPaths` a bit. If the resolver is switched to best match then
179-
feel like the need for `additionalPathsOnly` is much stronger. There would
180+
devalues `paths` a bit. If the resolver is switched to best match then, the need
181+
for configuration around best versus first match is much stronger. There would
180182
certainly be a customer segment that wanted to isolate from machine state in
181183
that case.
182184

0 commit comments

Comments
 (0)