diff --git a/Directory.Build.targets b/Directory.Build.targets
index d4a4e9a2a04d..34e36b4b06bd 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -134,14 +134,20 @@
$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).0.0
+
+ $(DefaultNetCoreTargetFramework)
+ netcoreapp$(TargetFrameworkVersion.TrimStart('vV'))
+
+
- $(MicrosoftNETCoreAppRuntimeVersion)
+ $(MicrosoftNETCoreAppRuntimeVersion)
- $(MicrosoftNETCoreAppRuntimeVersion)
+ $(MicrosoftNETCoreAppRuntimeVersion)
- $(MicrosoftNETCoreAppRefPackageVersion)
+ $(MicrosoftNETCoreAppRefPackageVersion)
diff --git a/eng/Workarounds.targets b/eng/Workarounds.targets
index a2cc87f1a07b..863e0c471638 100644
--- a/eng/Workarounds.targets
+++ b/eng/Workarounds.targets
@@ -22,7 +22,9 @@
-
+
@@ -40,11 +42,6 @@
-
- $(DefaultNetCoreTargetFramework)
- netcoreapp5.0
-
-
- net$(TargetFrameworkVersion.Substring(1).Replace('.',''))
+ net$(TargetFrameworkVersion.TrimStart('vV').Replace('.',''))
.NETFramework
diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Sdk.Razor.CurrentVersion.targets b/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Sdk.Razor.CurrentVersion.targets
index 59c8868339b9..b5b91fb8f243 100644
--- a/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Sdk.Razor.CurrentVersion.targets
+++ b/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Sdk.Razor.CurrentVersion.targets
@@ -38,9 +38,10 @@ Copyright (c) .NET Foundation. All rights reserved.
- <_TargetFrameworkVersionWithoutV>$(TargetFrameworkVersion.TrimStart('vV'))
- <_TargetingNETCoreApp30OrLater Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(_TargetFrameworkVersionWithoutV)' >= '3.0'">true
- <_TargetingNET50OrLater Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(_TargetFrameworkVersionWithoutV)' >= '5.0'">true
+ <_TargetingNETCoreApp30OrLater Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND
+ $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '3.0')) ">true
+ <_TargetingNET50OrLater Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND
+ $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '5.0')) ">true
- true
+ true
diff --git a/src/Tools/dotnet-watch/src/assets/DotNetWatch.targets b/src/Tools/dotnet-watch/src/assets/DotNetWatch.targets
index 7ef050fc8c20..26316b06e190 100644
--- a/src/Tools/dotnet-watch/src/assets/DotNetWatch.targets
+++ b/src/Tools/dotnet-watch/src/assets/DotNetWatch.targets
@@ -11,8 +11,8 @@ them to a file.
DependsOnTargets="_CollectWatchItems">
- <_IsMicrosoftNETCoreApp31OrNewer
- Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' And $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '3.1'))">true
+ <_IsMicrosoftNETCoreApp31OrNewer Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND
+ $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '3.1'))">true
<_IsMicrosoftNETCoreApp31OrNewer Condition="'$(_IsMicrosoftNETCoreApp31OrNewer)' == ''">false