Skip to content

Commit b59fdb4

Browse files
authored
Add support for .NET 10 (#340)
1 parent b30b9f9 commit b59fdb4

File tree

10 files changed

+341
-15
lines changed

10 files changed

+341
-15
lines changed

.github/workflows/CI.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ env:
1818
ContinuousIntegrationBuild: 'true'
1919
DotNet8Version: '8.x'
2020
DotNet9Version: '9.x'
21+
DotNet10Version: '10.x'
2122

2223
jobs:
2324
BuildAndTest:
@@ -49,6 +50,12 @@ jobs:
4950
${{ env.DotNet8Version }}
5051
${{ env.DotNet9Version }}
5152
53+
- name: Install .NET ${{ env.DotNet10Version }}
54+
uses: actions/setup-dotnet@v5
55+
with:
56+
dotnet-version: ${{ env.DotNet10Version }}
57+
dotnet-quality: 'preview'
58+
5259
- name: Build Solution
5360
run: dotnet build "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}/build.binlog"
5461

@@ -62,6 +69,9 @@ jobs:
6269
- name: Run Unit Tests (.NET 9)
6370
run: dotnet test --no-restore --no-build --framework net9.0 "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}/test-net9.0.binlog"
6471

72+
- name: Run Unit Tests (.NET 10)
73+
run: dotnet test --no-restore --no-build --framework net10.0 "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}/test-net10.0.binlog"
74+
6575
- name: Upload Artifacts
6676
uses: actions/upload-artifact@v4
6777
if: success()

.github/workflows/Official.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515
BuildPlatform: 'Any CPU'
1616
ContinuousIntegrationBuild: 'true'
1717
OfficialBuild: 'true'
18-
DotNet9Version: '9.x'
18+
DotNet10Version: '10.x'
1919

2020
jobs:
2121
build:
@@ -28,11 +28,12 @@ jobs:
2828
with:
2929
fetch-depth: 0
3030

31-
- name: Install .NET ${{ env.DotNet9Version }}
31+
- name: Install .NET ${{ env.DotNet10Version }}
3232
uses: actions/setup-dotnet@v5
3333
with:
3434
dotnet-version: |
35-
${{ env.DotNet9Version }}
35+
${{ env.DotNet10Version }}
36+
dotnet-quality: 'preview'
3637

3738
- name: Build Solution
3839
run: dotnet build "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}\build.binlog"

Directory.Packages.props

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
55
<MicrosoftBuildPackageVersion>17.14.8</MicrosoftBuildPackageVersion>
66
<MicrosoftBuildPackageVersion Condition="'$(TargetFramework)' == 'net8.0' ">17.11.4</MicrosoftBuildPackageVersion>
7-
<SystemTextJsonVersion>9.0.8</SystemTextJsonVersion>
87
</PropertyGroup>
98
<ItemGroup>
109
<PackageVersion Include="AssemblyShader" Version="1.1.3" />
@@ -17,7 +16,6 @@
1716
<PackageVersion Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="3.14.2075" />
1817
<PackageVersion Include="Shouldly" Version="4.3.0" />
1918
<PackageVersion Include="System.IO.Compression" Version="4.3.0" />
20-
<PackageVersion Include="System.Text.Json" Version="$(SystemTextJsonVersion)" />
2119
<PackageVersion Include="xunit" Version="2.9.3" />
2220
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.4" />
2321
</ItemGroup>

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "9.0",
3+
"version": "10.0.100-alpha",
44
"rollForward": "latestMinor",
55
"allowPrerelease": true
66
}

src/Microsoft.Build.Utilities.ProjectCreation.UnitTests/Microsoft.Build.Utilities.ProjectCreation.UnitTests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net472;net8.0;net9.0</TargetFrameworks>
3+
<TargetFrameworks>net472;net8.0;net9.0;net10.0</TargetFrameworks>
44
<IsPackable>false</IsPackable>
55
</PropertyGroup>
66
<Import Project="..\Microsoft.Build.Utilities.ProjectCreation\build\MSBuild.ProjectCreation.props" Condition="'$(TargetFramework)' == 'net472'" />
@@ -12,6 +12,7 @@
1212
<PackageReference Include="Microsoft.NET.Test.Sdk" ShadeDependencies="NuGet.Frameworks" />
1313
<PackageReference Include="Shouldly" />
1414
<PackageReference Include="System.CodeDom" VersionOverride="9.0.0" Condition="'$(TargetFramework)' == 'net9.0'" ExcludeAssets="All" />
15+
<PackageReference Include="System.CodeDom" VersionOverride="10.0.0-rc.1.25451.107" Condition="'$(TargetFramework)' == 'net10.0'" ExcludeAssets="All" />
1516
<PackageReference Include="xunit" />
1617
<PackageReference Include="xunit.runner.visualstudio" />
1718
</ItemGroup>

src/Microsoft.Build.Utilities.ProjectCreation.UnitTests/TestBase.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ public string DotNetSdkVersion
2121
#if NET8_0 || NETFRAMEWORK
2222
"8.0.100";
2323
#elif NET9_0 || NETFRAMEWORK
24-
"9.0.0";
24+
"9.0.100";
25+
#elif NET10_0 || NETFRAMEWORK
26+
"10.0.100";
2527
#else
2628
#error Unknown target framework!
2729
#endif
@@ -34,6 +36,8 @@ public string TargetFramework
3436
"net8.0";
3537
#elif NET9_0
3638
"net9.0";
39+
#elif NET10_0
40+
"net10.0";
3741
#elif NETFRAMEWORK
3842
"net472";
3943
#else
@@ -87,4 +91,4 @@ private void WriteGlobalJson()
8791
}}");
8892
}
8993
}
90-
}
94+
}

src/Microsoft.Build.Utilities.ProjectCreation/Microsoft.Build.Utilities.ProjectCreation.csproj

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net472;net8.0;net9.0</TargetFrameworks>
3+
<TargetFrameworks>net472;net8.0;net9.0;net10.0</TargetFrameworks>
44
<GenerateDocumentationFile>true</GenerateDocumentationFile>
55
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
66
<ArtifactsPath>..\..\artifacts\$(MSBuildProjectName)</ArtifactsPath>
77
<CopyArtifactsAfterTargets>Pack</CopyArtifactsAfterTargets>
88
<DefaultArtifactsFileMatch>*nupkg</DefaultArtifactsFileMatch>
99
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
10-
<!-- Remove NU5104 once System.CodeDom is a stable version for .NET 9 -->
11-
<NoWarn>$(NoWarn);RS0026;SA1600;NU5104</NoWarn>
10+
<NoWarn>$(NoWarn);RS0026;SA1600</NoWarn>
1211
</PropertyGroup>
1312
<PropertyGroup Label="Package properties">
1413
<PackageId>MSBuild.ProjectCreation</PackageId>
1514
<Description>A fluent interface for generating and building MSBuild project files.</Description>
15+
<PackageReadmeFile>README.md</PackageReadmeFile>
1616
<Authors>jeffkl</Authors>
1717
<Copyright>Copyright (c) Jeff Kluge. All rights reserved.</Copyright>
1818
<PackageLicenseExpression>MIT</PackageLicenseExpression>
@@ -33,7 +33,6 @@
3333
<PackageReference Include="Microsoft.IO.Redist" Condition="'$(TargetFramework)' == 'net472'" />
3434
<PackageReference Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Condition="'$(TargetFramework)' == 'net472'" ExcludeAssets="Runtime" PrivateAssets="All" />
3535
<PackageReference Include="System.IO.Compression" Condition="'$(TargetFramework)' == 'net472'" />
36-
<PackageReference Include="System.Text.Json" />
3736
<PackageReference Include="System.ValueTuple" VersionOverride="4.5.0" Condition="'$(TargetFramework)' == 'net472'" ExcludeAssets="Compile" />
3837
</ItemGroup>
3938
<ItemGroup>
@@ -58,4 +57,4 @@
5857
<None Include="PublicAPI\**" />
5958
<AdditionalFiles Include="PublicAPI\$(TargetFramework)\PublicAPI.*.txt" />
6059
</ItemGroup>
61-
</Project>
60+
</Project>

0 commit comments

Comments
 (0)