|
31 | 31 | <GitHubProject>lucenenet</GitHubProject> |
32 | 32 | </PropertyGroup> |
33 | 33 |
|
| 34 | + <PropertyGroup Label="Legacy Visual Studio Support"> |
| 35 | + <VisualStudioMajorVersion>0</VisualStudioMajorVersion> |
| 36 | + <!-- Extract major version (works for preview builds too) --> |
| 37 | + <VisualStudioMajorVersion Condition="'$(VisualStudioVersion)' != ''">$([System.Version]::Parse($([System.Text.RegularExpressions.Regex]::Match('$(VisualStudioVersion)', '^\d+(\.\d+)*').Value)).Major)</VisualStudioMajorVersion> |
| 38 | + <IsLegacyVisualStudioVersion>false</IsLegacyVisualStudioVersion> |
| 39 | + <!-- Visual Studio 2026 == Version 18.x - anything below that major version is legacy --> |
| 40 | + <IsLegacyVisualStudioVersion Condition="'$(BuildingInsideVisualStudio)' == 'true' And '$(VisualStudioMajorVersion)' < '18'">true</IsLegacyVisualStudioVersion> |
| 41 | + </PropertyGroup> |
| 42 | + |
34 | 43 | <PropertyGroup Label="Centralized Target Frameworks"> |
35 | | - <!-- Base frameworks without net10.0 --> |
36 | | - <LibraryTargetFrameworksBase>net8.0;netstandard2.0;net462</LibraryTargetFrameworksBase> |
37 | | - <NetCoreOnlyTargetFrameworksBase>net8.0</NetCoreOnlyTargetFrameworksBase> |
| 44 | + <!-- net10.0 is conditional on VS version (VS2024+ = 18.0) --> |
| 45 | + <!-- .NET Framework and netstandard2.0 are conditional on VS version (VS2024+ = 18.0) due to invalid build warnings with C# 14.0 build features --> |
38 | 46 |
|
39 | | - <!-- Add net10.0 conditionally based on VS version (VS2024+ = 18.0) --> |
40 | | - <LibraryTargetFrameworks Condition=" '$(VisualStudioVersion)' >= '18.0' ">net10.0;$(LibraryTargetFrameworksBase)</LibraryTargetFrameworks> |
41 | | - <LibraryTargetFrameworks Condition=" '$(VisualStudioVersion)' < '18.0' Or '$(VisualStudioVersion)' == '' ">$(LibraryTargetFrameworksBase)</LibraryTargetFrameworks> |
| 47 | + <LibraryTargetFrameworks>net10.0;net8.0;netstandard2.0;net462</LibraryTargetFrameworks> |
| 48 | + <LibraryTargetFrameworks Condition=" '$(IsLegacyVisualStudioVersion)' == 'true' ">net8.0</LibraryTargetFrameworks> |
42 | 49 |
|
43 | | - <NetCoreOnlyTargetFrameworks Condition=" '$(VisualStudioVersion)' >= '18.0' ">net10.0;$(NetCoreOnlyTargetFrameworksBase)</NetCoreOnlyTargetFrameworks> |
44 | | - <NetCoreOnlyTargetFrameworks Condition=" '$(VisualStudioVersion)' < '18.0' Or '$(VisualStudioVersion)' == '' ">$(NetCoreOnlyTargetFrameworksBase)</NetCoreOnlyTargetFrameworks> |
| 50 | + <NetCoreOnlyTargetFrameworks>net10.0;net8.0</NetCoreOnlyTargetFrameworks> |
| 51 | + <NetCoreOnlyTargetFrameworks Condition=" '$(IsLegacyVisualStudioVersion)' == 'true' ">net8.0</NetCoreOnlyTargetFrameworks> |
45 | 52 | </PropertyGroup> |
46 | 53 |
|
47 | 54 | <!-- IMPORTANT: When these values are changed, the CI counter number should also be reset. --> |
|
0 commit comments