Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Always compare TPA versions (#4423) #4521

Merged

Conversation

steveharter
Copy link
Member

@steveharter steveharter commented Aug 31, 2018

Fixes https://github.com/dotnet/core-setup/issues/4512
Original issue: https://github.com/dotnet/core-setup/issues/4376

Description
Compare assemblyVersion\fileVersion for patch roll-forward cases to support better serviceability and to prevent run-time FileLoadException from occurring due to assembly-to-assembly versions being too low. Previously the runtime only compared versions for minor- and major roll-forward scenarios. The reason was because it allowed for the app to have complete control over any duplicated assemblies that exist in the app bin location, to support build-from-source and other explicit scenarios.

Customer Impact
If an application wishes to always load their "app local" copies of framework assemblies (for example, if they have a build-from-source scenario with new features or bug fixes) then they should prevent Minor\Major roll-forward and patch roll-forward from occurring by modifying their runtimeconfig.json to add applyPatches:false and rollForwardOnNoCandidateFx" : 0 like so:

{
  "runtimeOptions": {
    "tfm": "netcoreapp2.1",
    "applyPatches" : false,
    "rollForwardOnNoCandidateFx" : 0,
    "framework": {
      "name": "Microsoft.NETCore.App",
      "version": "<yourversion>"
    }
  }
}

Regression?
No

Risk
Some, although should be rare. As noted in the description, this helps with serviceability when we release new versions of framework assemblies in a patch release. However, if the customer always expects the older "app local" version to be loaded then they will need to either:

  • Manually apply the runtimeconfig.json changes above to prevent patch versions from being loaded
  • Don't install the patch version
  • Modify the application to not require a reference to the framework assembly
  • Modify the application to not require an older version of the framework assembly

@steveharter steveharter added this to the 2.1.x milestone Aug 31, 2018
@steveharter steveharter self-assigned this Aug 31, 2018
@steveharter steveharter added the * NO MERGE * The PR is not ready for merge yet (see discussion for detailed reasons) label Aug 31, 2018
@natemcmaster natemcmaster added the Servicing-consider Issue for next servicing release review label Aug 31, 2018
@danmoseley danmoseley removed the Servicing-consider Issue for next servicing release review label Sep 4, 2018
@danmoseley
Copy link
Member

Waiting on email.

@jamshedd jamshedd added the Servicing-approved Approved for servicing release label Sep 4, 2018
@jamshedd
Copy link
Member

jamshedd commented Sep 4, 2018

Approved for 2.1.5. Test plan required to mitigate risk.

@steveharter
Copy link
Member Author

Test plan added at https://github.com/dotnet/core-setup/issues/4541. In general, there are two areas of concern:

  1. Having proper manual\automated testing to ensure correct assembly is loaded and the bug is fixed
  2. Unexpected\unknown side effects (besides the Customer Impact identified in the description of this PR around the app expecting "app local" to be used during patch roll-forward).

The test plan covers 1 and adds additional tests in second commit in this PR that verify TPA version checks in additional scenarios, ensuring behavior is as exepected between app and framework(s) regarding who will win by TPA version, ties and ensure roll-forward behavior (including patch) does not affect that.

@steveharter steveharter removed the * NO MERGE * The PR is not ready for merge yet (see discussion for detailed reasons) label Sep 13, 2018
@steveharter
Copy link
Member Author

Feedback from separate mail thread indicates this is OK to merge

@steveharter steveharter merged commit 75426ae into dotnet:release/2.1 Sep 13, 2018
@steveharter steveharter deleted the port-always-compare-version branch September 13, 2018 14:20
@danmoseley danmoseley modified the milestones: 2.1.x, 2.1.5 Sep 13, 2018
dsplaisted added a commit to dotnet/sdk that referenced this pull request Oct 17, 2018
This test was previously incorrect.  It was using the wrong property name to try to disable version information
from being written to the deps file.  This meant that version information was being written to the deps file.
Furthermore, the test expectation was backwards from the test name: the test was erroneously expecting
the DLL to be loaded from the app's publish directory.

The broken version of the test started failing once we got a stage 0 that included this fix:
dotnet/core-setup#4521.  That PR changed the behavior when the versions of
the file in the published app and the runtime matched.  In that case, the runtime will now prefer the
runtime copy instead of the app's copy.
nguerrera pushed a commit to nguerrera/sdk that referenced this pull request Oct 17, 2018
This test was previously incorrect.  It was using the wrong property name to try to disable version information
from being written to the deps file.  This meant that version information was being written to the deps file.
Furthermore, the test expectation was backwards from the test name: the test was erroneously expecting
the DLL to be loaded from the app's publish directory.

The broken version of the test started failing once we got a stage 0 that included this fix:
dotnet/core-setup#4521.  That PR changed the behavior when the versions of
the file in the published app and the runtime matched.  In that case, the runtime will now prefer the
runtime copy instead of the app's copy.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants