Skip to content

Commit 7c99aaa

Browse files
authored
fix: Fix MSBuild version detection for .NET 10 task assembly selection (#34)
1 parent 729a600 commit 7c99aaa

2 files changed

Lines changed: 24 additions & 5 deletions

File tree

src/JD.Efcpt.Build.Tasks/packages.lock.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@
7373
"SQLitePCLRaw.core": "2.1.10"
7474
}
7575
},
76+
"Microsoft.NETFramework.ReferenceAssemblies": {
77+
"type": "Direct",
78+
"requested": "[1.0.3, )",
79+
"resolved": "1.0.3",
80+
"contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==",
81+
"dependencies": {
82+
"Microsoft.NETFramework.ReferenceAssemblies.net472": "1.0.3"
83+
}
84+
},
7685
"MySqlConnector": {
7786
"type": "Direct",
7887
"requested": "[2.4.0, )",
@@ -494,6 +503,11 @@
494503
"System.Runtime.CompilerServices.Unsafe": "6.1.0"
495504
}
496505
},
506+
"Microsoft.NETFramework.ReferenceAssemblies.net472": {
507+
"type": "Transitive",
508+
"resolved": "1.0.3",
509+
"contentHash": "0E7evZXHXaDYYiLRfpyXvCh+yzM2rNTyuZDI+ZO7UUqSc6GfjePiXTdqJGtgIKUwdI81tzQKmaWprnUiPj9hAw=="
510+
},
497511
"Mono.Unix": {
498512
"type": "Transitive",
499513
"resolved": "7.1.0-final.1.21458.1",

src/JD.Efcpt.Build/buildTransitive/JD.Efcpt.Build.targets

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,17 @@
2626
<PropertyGroup>
2727
<!--
2828
For .NET Core MSBuild, select task assembly based on MSBuild version:
29-
- MSBuild 17.12+ (VS 17.12+, .NET 10 SDK) -> net10.0
30-
- MSBuild 17.10+ (VS 17.10+, .NET 9 SDK) -> net9.0
31-
- MSBuild 17.8+ (VS 17.8+, .NET 8 SDK) -> net8.0
29+
- MSBuild 18.0+ (VS 2026, .NET 10.0.1xx SDK) -> net10.0
30+
- MSBuild 17.14+ (VS 2022 17.14+, min VS for .NET 10 SDK) -> net10.0
31+
- MSBuild 17.12+ (VS 2022 17.12+, .NET 9.0.1xx SDK) -> net9.0
32+
- MSBuild 17.8+ (VS 2022 17.8+, .NET 8.0.1xx SDK) -> net8.0
33+
34+
Version mapping reference:
35+
https://learn.microsoft.com/en-us/dotnet/core/porting/versioning-sdk-msbuild-vs
3236
-->
33-
<_EfcptTasksFolder Condition="'$(MSBuildRuntimeType)' == 'Core' and $([MSBuild]::VersionGreaterThanOrEquals('$(MSBuildVersion)', '17.12'))">net10.0</_EfcptTasksFolder>
34-
<_EfcptTasksFolder Condition="'$(_EfcptTasksFolder)' == '' and '$(MSBuildRuntimeType)' == 'Core' and $([MSBuild]::VersionGreaterThanOrEquals('$(MSBuildVersion)', '17.10'))">net9.0</_EfcptTasksFolder>
37+
<_EfcptTasksFolder Condition="'$(MSBuildRuntimeType)' == 'Core' and $([MSBuild]::VersionGreaterThanOrEquals('$(MSBuildVersion)', '18.0'))">net10.0</_EfcptTasksFolder>
38+
<_EfcptTasksFolder Condition="'$(_EfcptTasksFolder)' == '' and '$(MSBuildRuntimeType)' == 'Core' and $([MSBuild]::VersionGreaterThanOrEquals('$(MSBuildVersion)', '17.14'))">net10.0</_EfcptTasksFolder>
39+
<_EfcptTasksFolder Condition="'$(_EfcptTasksFolder)' == '' and '$(MSBuildRuntimeType)' == 'Core' and $([MSBuild]::VersionGreaterThanOrEquals('$(MSBuildVersion)', '17.12'))">net9.0</_EfcptTasksFolder>
3540
<_EfcptTasksFolder Condition="'$(_EfcptTasksFolder)' == '' and '$(MSBuildRuntimeType)' == 'Core'">net8.0</_EfcptTasksFolder>
3641

3742
<!-- For .NET Framework MSBuild (Visual Studio with Framework MSBuild), use net472 -->

0 commit comments

Comments
 (0)