Skip to content

Commit

Permalink
Small fix to evaluate ASP.NET targeting patch dynamically. (#801)
Browse files Browse the repository at this point in the history
* Delay evaluating TargetLatestAspNetCoreRuntimePatch until build time.

If this is evaluated in the production build, it ends up being a constant in the final build.

* Update patch comment to include more details.

* Clarify what we're trying to accomplish.
  • Loading branch information
crummel authored Oct 8, 2018
1 parent f83d81a commit 1e0534a
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From d6f6922c24e205a53bc5f2420695a4a177648808 Mon Sep 17 00:00:00 2001
From dfe28f2b2cfbe8878e637a51a79ab55f8dd41ed7 Mon Sep 17 00:00:00 2001
From: Davis Goodin <[email protected]>
Date: Wed, 13 Jun 2018 09:46:43 -0500
Subject: [PATCH] Persist ASP.NET runtime patch targeting default
Expand All @@ -7,23 +7,28 @@ Let the CLI build take a default value for TargetLatestAspNetCoreRuntimePatch in

https://github.com/dotnet/cli/issues/9469 is required to remove this patch.
---
build/MSBuildExtensions.targets | 3 +++
1 file changed, 3 insertions(+)
build/MSBuildExtensions.targets | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/build/MSBuildExtensions.targets b/build/MSBuildExtensions.targets
index f5365724a..f192226b8 100644
index f5365724a..fd2fa3719 100644
--- a/build/MSBuildExtensions.targets
+++ b/build/MSBuildExtensions.targets
@@ -196,6 +196,9 @@ Copyright (c) .NET Foundation. All rights reserved.
@@ -196,6 +196,14 @@ Copyright (c) .NET Foundation. All rights reserved.
<LatestPatchVersionForNetCore1_0 Condition="'%24(LatestPatchVersionForNetCore1_0)' == ''">1.0.12</LatestPatchVersionForNetCore1_0>
<LatestPatchVersionForNetCore1_1 Condition="'%24(LatestPatchVersionForNetCore1_1)' == ''">1.1.9</LatestPatchVersionForNetCore1_1>
<LatestPatchVersionForNetCore2_0 Condition="'%24(LatestPatchVersionForNetCore2_0)' == ''">2.0.9</LatestPatchVersionForNetCore2_0>
+
+ <!-- If true, always target the latest ASP.NET Core runtime by default -->
+ <TargetLatestAspNetCoreRuntimePatch Condition="'$(TargetLatestAspNetCoreRuntimePatch)' == ''">$(DefaultTargetLatestAspNetCoreRuntimePatch)</TargetLatestAspNetCoreRuntimePatch>
+ <!-- In source-build, override the default behavior to always target the latest ASP.NET Core runtime.
+ Normally, a published application will use the latest patch version of the shared ASP.NET framework.
+ Source-build does not include the shared ASP.NET Framework, so it will use the latest .0 version instead.
+ The .0 version may not be up-to-date, so this can introduce security issues. Here we override this choice for
+ all apps so they use the latest patch version instead of the .0 version.
+ See https://github.com/dotnet/source-build/issues/586 for more discussion. -->
+ <TargetLatestAspNetCoreRuntimePatch Condition="'%24(TargetLatestAspNetCoreRuntimePatch)' == ''">$(DefaultTargetLatestAspNetCoreRuntimePatch)</TargetLatestAspNetCoreRuntimePatch>
</PropertyGroup>
</Project>
]]>
--
2.17.1.windows.2
2.18.0

0 comments on commit 1e0534a

Please sign in to comment.