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/design/features/framework-version-resolution.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# Framework version resolution
2
2
3
3
This document describes .NET Core 3.0 version resolution behavior when the host resolves framework references for framework dependent apps.
4
-
It's just a part of the overall framework resolution scenario described in [multilevel-sharedfx-lookup](multilevel-sharedfx-lookup.md).
4
+
It's just a part of the overall framework resolution scenario described in [sharedfx-lookup](sharedfx-lookup.md).
5
5
6
6
## Framework references
7
7
Application defines its framework dependencies in its `.runtimeconfig.json` file. Each framework then defines its dependencies in its copy of `.runtimeconfig.json`. Each dependency is expressed as a framework reference. Together these form a graph. The host must resolve the references by finding the actual frameworks which are available on the machine. It must also unify references if there are multi references to the same framework.
Copy file name to clipboardExpand all lines: docs/design/features/host-components.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ The entry-point typically does just one thing: it finds the `hostfxr` library an
20
20
## Host FXR
21
21
This library finds and resolves the runtime and all the frameworks the app needs. Then it loads the `hostpolicy` library and transfers control to it.
22
22
23
-
The host FXR library reads the `.runtimeconfig.json` of the app (and all it's dependent frameworks) and resolves the frameworks. It implements the algorithm for framework resolution as described in [SharedFX Lookup](multilevel-sharedfx-lookup.md) and in [Framework version resolution](framework-version-resolution.md).
23
+
The host FXR library reads the `.runtimeconfig.json` of the app (and all it's dependent frameworks) and resolves the frameworks. It implements the algorithm for framework resolution as described in [SharedFX Lookup](sharedfx-lookup.md) and in [Framework version resolution](framework-version-resolution.md).
24
24
25
25
In most cases the latest available version of `hostfxr` is used. Self-contained apps use `hostfxr` from the app folder.
Copy file name to clipboardExpand all lines: docs/design/features/host-probing.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ The list of probing paths ordered according to their priority. First path in the
48
48
If the app (or framework) has dependencies on frameworks, these frameworks are used as probing paths.
49
49
The order is from the higher level framework to lower level framework. The app is considered the highest level, it direct dependencies are next and so on.
50
50
For assets from frameworks, only that framework and lower level frameworks are considered.
51
-
Note: These directories come directly out of the framework resolution process. Special note on Windows where global locations are always considered even if the app is not executed via the shared `dotnet.exe`. More details can be found in [Multi-level Shared FX Lookup](multilevel-sharedfx-lookup.md).
51
+
Note: These directories come directly out of the framework resolution process. Special note on Windows where global locations are always considered even if the app is not executed via the shared `dotnet.exe`. More details can be found in [Shared FX Lookup](sharedfx-lookup.md).
52
52
* Shared store paths
53
53
*`$DOTNET_SHARED_STORE/|arch|/|tfm|` - The environment variable `DOTNET_SHARED_STORE` can contain multiple paths, in which case each is appended with `|arch|/|tfm|` and used as a probing path.
54
54
* If the app is executed through `dotnet.exe` then path relative to the directory with the `dotnet.exe` is used
Copy file name to clipboardExpand all lines: docs/design/features/sharedfx-lookup.md
+24-6Lines changed: 24 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
# Multi-level SharedFX Lookup
1
+
# SharedFX Lookup
2
2
3
3
## Introduction
4
4
5
-
There are two possible ways of running .NET Core Applications: through dotnet.exe or through a custom executable appname.exe. The first one is used when the user wants to run a framework-dependent app or a .NET Core command while the second one is used for self-contained applications. Both executables share exactly the same source code.
5
+
There are two main ways of running .NET Applications: through `dotnet` or through the `apphost` executables. The executable is in charge of finding and loading `hostfxr`. `hostfxr`, in turn, must find and load `hostpolicy`. It is also responsible for searching for the SDK when running .NET SDK commands. Finally, `hostpolicy` must find and load the runtime (`coreclr`). See [host components](host-components.md) for details.
6
6
7
-
The executable is in charge of finding and loading the hostfxr.dll file. The hostfxr, in turn, must find and load the hostpolicy.dll file (it’s also responsible for searching for the SDK when running .NET commands). At last the coreclr.dll file must be found and loaded by the hostpolicy. Self-contained apps are supposed to keep all its dependencies in the same location as the executable. Framework-dependent apps must have the runtime files inside predefined folders.
7
+
An application can either be [framework-dependent](https://docs.microsoft.com/dotnet/core/deploying/#publish-framework-dependent) or [self-contained](https://docs.microsoft.com/dotnet/core/deploying/#publish-self-contained). Framework-dependent apps must have the runtime files inside predefined folders. Self-contained apps are expected to have their dependencies in the same location as the executable.
8
8
9
9
## Semantic Versioning
10
10
@@ -219,6 +219,16 @@ In order to compare versions of an assembly, the assemblyVersion and fileVersion
219
219
220
220
## Global locations
221
221
222
+
Global install locations are described in the [install locations design](https://github.com/dotnet/designs/blob/main/accepted/2020/install-locations.md) document.
223
+
224
+
**.NET 7.0 and above**
225
+
226
+
When running `dotnet`, only the executable directory will be searched and global locations are not searched. For all other [entry-point hosts](host-components.md#entry-point-hosts), if the `DOTNET_ROOT` environment variable is set, that path is searched. If the environment variable is not set, the global location as described in [install locations](https://github.com/dotnet/designs/blob/main/accepted/2020/install-locations.md) is searched.
227
+
228
+
See [disable multi-level lookup](https://github.com/dotnet/designs/blob/main/accepted/2022/disable-multi-level-lookup-by-default.md) for more details.
229
+
230
+
**Before .NET 7.0**
231
+
222
232
In addition to searching the executable directory, the global .NET location is also searched. The global folders may vary depending on the running operational system. They are defined as follows:
223
233
224
234
Global .NET location:
@@ -271,11 +281,19 @@ To make sure that the changes are working correctly, the following behavior cond
271
281
272
282
### SDK search
273
283
274
-
Like the Framework search, the SDK is searched for a compatible version. Instead of looking for it only in relation to the executable directory, it is also searched in the folders specified above by following the same priority rank.
284
+
Like the Framework search, the SDK is searched for a compatible version.
285
+
286
+
Unlike the Framework search, the SDK search does a roll-forward for pre-release versions when the patch version changes. For example, if you install v2.0.1-pre, it will be used over v2.0.0.
287
+
288
+
**.NET 7.0 and above**
289
+
290
+
Only the executable directory will be searched. See [disable multi-level lookup](https://github.com/dotnet/designs/blob/main/accepted/2022/disable-multi-level-lookup-by-default.md) for more details.
291
+
292
+
**Before .NET 7.0**
293
+
294
+
Aside from looking for it in relation to the executable directory, it is also searched in the folders specified above by following the same priority rank.
275
295
276
296
The search is conducted as follows:
277
297
278
298
1. In relation to the executable directory: search for the specified version. If it cannot be found, choose the most appropriate available version. If there’s no available version, proceed to the next step.
279
299
2. In relation to the global location: search for the specified version. If it cannot be found, choose the most appropriate available version. If there’s no available version, then we were not able to find any version folder and an error message is returned.
280
-
281
-
Unlike the Framework search, the SDK search does a roll-forward for pre-release versions when the patch version changes. For example, if you install v2.0.1-pre, it will be used over v2.0.0.
Copy file name to clipboardExpand all lines: src/installer/tests/HostActivation.Tests/FrameworkResolution/FrameworkResolutionCommandResultExtensions.cs
+13-7Lines changed: 13 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -35,26 +35,32 @@ public static AndConstraint<CommandResultAssertions> ShouldHaveResolvedFramework
Copy file name to clipboardExpand all lines: src/installer/tests/HostActivation.Tests/FrameworkResolution/RollForwardAndRollForwardOnNoCandidateFxSettings.cs
0 commit comments