Skip to content

Commit 5f37b37

Browse files
committed
Use .NET 10
1 parent 3281dba commit 5f37b37

File tree

4 files changed

+18
-22
lines changed

4 files changed

+18
-22
lines changed

eng/Build.proj

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,27 +50,11 @@
5050

5151
<Exec Command="dotnet --info" WorkingDirectory="$(ArtifactsDir)" />
5252

53-
<!-- Due to bug https://github.com/dotnet/sdk/issues/47008 we cannot pass paths that contain drive letters to "dotnet sln add".
54-
We do some contortion here to make the paths relative, and run them from the root directory. This code is a big ugly because
55-
there's no Path.GetRelativePath on .NET Framework. -->
56-
<PropertyGroup>
57-
<DriveRootPath>$([System.IO.Path]::GetPathRoot('$(ArtifactsDir)'))</DriveRootPath>
58-
<ArtifactsDirRelative>$([System.String]::Copy('$(ArtifactsDir)').Substring(3))</ArtifactsDirRelative>
59-
</PropertyGroup>
60-
6153
<!-- Create the solution. Use 'force' to override existing. -->
62-
<Exec Command="dotnet new sln -n $(MSBuildProjectName) -o $(ArtifactsDir) --force" WorkingDirectory="$(DriveRootPath)" />
63-
64-
<!-- Strip the drive letter and backslash, e.g. D:\ => -->
65-
<ItemGroup>
66-
<BuildProjectWithRel Include="@(BuildProject)">
67-
<!-- Trim the first three characters: D:\ -->
68-
<RelPath>$([System.String]::Copy('%(BuildProject.FullPath)').Substring(3))</RelPath>
69-
</BuildProjectWithRel>
70-
</ItemGroup>
54+
<Exec Command="dotnet new sln -n $(MSBuildProjectName) -o $(ArtifactsDir) -f sln --force" WorkingDirectory="$(DriveRootPath)" />
7155

7256
<!-- Add each BuildProject to the solution. -->
73-
<Exec Command="dotnet sln &quot;$(ArtifactsDirRelative)/$(MSBuildProjectName).sln&quot; add &quot;%(BuildProjectWithRel.RelPath)&quot;" WorkingDirectory="$(DriveRootPath)" />
57+
<Exec Command="dotnet sln &quot;$(ArtifactsDir)$(MSBuildProjectName).sln&quot; add &quot;%(BuildProject.FullPath)&quot;" />
7458

7559
<!-- Build the solution. -->
7660
<MSBuild Projects="$(ArtifactsDir)$(MSBuildProjectName).sln" Targets="@(BuildTarget)" BuildInParallel="true" Condition="'@(BuildTarget)' != ''" />

eng/pipelines/templates/build-pull-request.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,19 @@ jobs:
3131

3232
# Ensure the .NET runtime needed by our unit tests is installed.
3333
- task: UseDotNet@2
34-
displayName: Install .NET Runtime
34+
displayName: Install .NET 9.0.x Runtime
3535
inputs:
3636
packageType: runtime
3737
# This should match the target of our unit test projects.
3838
version: 9.0.x
3939

40+
# .NET SDK used for build
41+
- task: UseDotNet@2
42+
displayName: Install .NET 10.x Runtime
43+
inputs:
44+
includePreviewVersions: true
45+
version: 10.x
46+
4047
# Allows for accessing the internal AzDO feed (vs-impl-internal) for project restore via Azure Artifacts Credential Provider.
4148
# See: https://github.com/microsoft/artifacts-credprovider#automatic-usage
4249
# YAML reference: https://docs.microsoft.com/azure/devops/pipelines/tasks/package/nuget-authenticate?view=azure-devops

eng/pipelines/templates/generate-localization.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ jobs:
2323
- task: UseDotNet@2
2424
displayName: Install .NET Runtime
2525
inputs:
26-
packageType: runtime
27-
# This should match the target in OneLocBuildSetup.csproj.
28-
version: 9.0.x
26+
includePreviewVersions: true
27+
version: 10.x
2928

3029
# Creates the LocProject.json and perform some necessary file copying and renaming.
3130
- task: DotNetCoreCLI@2

global.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sdk": {
3+
// necessary for VS to find pre-release SDKs
4+
"allowPrerelease": true
5+
}
6+
}

0 commit comments

Comments
 (0)