Update assembly-conflict-resolution.md
authorSteve Harter <steveharter@users.noreply.github.com>
Fri, 9 Feb 2018 15:34:02 +0000 (09:34 -0600)
committerGitHub <noreply@github.com>
Fri, 9 Feb 2018 15:34:02 +0000 (09:34 -0600)
Commit migrated from https://github.com/dotnet/core-setup/commit/5df6e9b7ab674a461b2a7f01ac87fb6e0ca06666

docs/installer/design-docs/assembly-conflict-resolution.md

index f629b2a..0707d03 100644 (file)
@@ -36,27 +36,26 @@ Once a deps.json entry has been found in a probe location, no further probes are
 #### Deps.json Ordering
 The order in which each layer's deps.json is processed is:
 *   The application
-*   Deps file specified by optional --additional-deps
+*   Deps file specified by optional `--additional-deps` argument
 *   The framework(s) from higher to lower
 
 #### Algorithm
 1. Determine the probing paths
-1. Read the app's deps.json
-1. ->For each assembly, loop through the probing paths
-1. ->If the assembly entry has not been found yet:
-1. ->->->If the probing path is a framework, then check its deps.json to see if it contains the exact package (by name and version). If so, then use the framework's location
-1. ->->->If the probing path is not a framework, then use that location
-1. Read the additional deps from --additional-deps and repeat steps 3-6
-1. Read each framework's deps.json and repeat steps 3-6
+1. For each entry in the app's deps.json
+1. ->For each probing path
+1. -->If the probing path is a framework, then check its deps.json to see if it contains the exact package (by name and version). If so, then use the framework's location and end probing for this entry
+1. -->If the probing path is not a framework, then use that location and end probing for this entry
+1. Read the additional deps from `--additional-deps` and repeat steps 3-5
+1. Read each framework's deps.json and repeat steps 3-5
 1. Pass the set of assemblies and their paths to the CLR
 
-Note that for an app, its probing path comes *after* the framework, so intuitively it would appear that "framework wins" in collisions. However, because the app's deps.json is parsed *before* the framework's deps.json and because the app will likely reference an OOB package that the framework doesn't (because a framework, at least Microsoft.NETCore.App, has its own metapackage and does not reference OOB packages), the framework probing path never matches up in step 5 for the app's deps.json package\assembly entry, so it goes to the next probing path which is the app's and the package should match up and thus "app wins".
+Note that for an app, its probing path comes *after* the framework's, so intuitively it would appear that "framework wins" in collisions. However, because the app's deps.json is parsed *before* the framework's deps.json and because the app will likely reference an OOB package that the framework doesn't (because a framework, at least Microsoft.NETCore.App, has its own metapackage and does not reference OOB packages), the framework probing path never matches up in step 4 for the app's deps.json package\assembly entry, so it goes to the next probing path which is the app's and because the package matches the "app wins".
 
 ## Proposed changes for 2.1
-Probe the app location before the framework's. This means flip (3) and (4) under **Probe Ordering** above and treat the app as the highest-level framework. The reason is that there may be frameworks that use OOB packages like apps, and we want to have "app wins" in such cases.
+Probe the app location before the framework's. This means flip (3) and (4) under **Probe Ordering** above and treat the app as the highest-level framework. The reason is that there may be frameworks that use OOB packages like apps, and we want to have "app wins" in non roll-forward cases.
 
-Replace step 5 under **Algorithm** above with:
-* If the probing path is a framework, and no [minor] or [major] roll-forward occurred on that framework, then check its deps.json to see if it contains the exact package (by name and version). If so, then use the framework's location
-* If the probing path is a framework, and a [minor] or [major] roll-forward occurred on that framework, then check its deps.json to see if it contains a newer version of the assembly (by Assembly Version and then File Version if necessary). If so, then use the framework's location
+Replace step 4 under **Algorithm** above with:
+* If the probing path is a framework, and no [minor] or [major] roll-forward occurred for this framework, then check its deps.json to see if it contains the exact package (by name and version). If so, then use the framework's location and end probing for this entry
+* If the probing path is a framework, and a [minor] or [major] roll-forward occurred for this framework, then check its deps.json to see if it contains a newer version of the assembly (by Assembly Version and then File Version if necessary). If so, then use the framework's location and end probing for this entry
 
-In order to compare Assembly Version and File Version, additional metadata will need to be written to each deps.json file. If this metadata is not present (as in the case of applications published prior to 2.1) then the files will be considered older and will not replace any previously found locations.
+In order to compare Assembly Version and File Version, additional metadata will need to be written to each deps.json file. If this metadata is not present (as in the case of applications published prior to 2.1) then the assembly will be considered older and will not replace any locations that the assembly was previously found at.