Skip to content

Commit 1e0534a

Browse files
authored
Small fix to evaluate ASP.NET targeting patch dynamically. (#801)
* 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.
1 parent f83d81a commit 1e0534a

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed
Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From d6f6922c24e205a53bc5f2420695a4a177648808 Mon Sep 17 00:00:00 2001
1+
From dfe28f2b2cfbe8878e637a51a79ab55f8dd41ed7 Mon Sep 17 00:00:00 2001
22
From: Davis Goodin <dagood@microsoft.com>
33
Date: Wed, 13 Jun 2018 09:46:43 -0500
44
Subject: [PATCH] Persist ASP.NET runtime patch targeting default
@@ -7,23 +7,28 @@ Let the CLI build take a default value for TargetLatestAspNetCoreRuntimePatch in
77

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

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

0 commit comments

Comments
 (0)