Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target .NET 10 #631

Merged
merged 14 commits into from
Nov 19, 2024
Merged

Target .NET 10 #631

merged 14 commits into from
Nov 19, 2024

Conversation

RussKie
Copy link
Member

@RussKie RussKie commented Nov 15, 2024

This change does the following:

  • Introduces an MSBuild property, TargetDotNet10, which is set to true only in CI by default, so that when building on a machine without .NET 10 you don't get a build error. You can manually install .NET 10 in a developer environment and set that environment variable to build and debug locally.
  • Updates MSBuild package to 17.12.6 and uses the net9.0 reference assemblies
  • Adds two NuGet feeds in order to get .NET 10 packages
  • Updates the build YAML to install daily builds of .NET 10 in CI. At build time, the runtimeconfig.json still just points to any .NET 10 runtime so we don't have to worry about always installing the same version.
  • Added logic to just fail on version of MSBuild older than 17.0 since net461 was dropped.
  • Updated tests that get solution folders under .NET 10 since those APIs in MSBuild changed and only list projects now for some reason.
  • Update SlnGen version to 12.0

@RussKie
Copy link
Member Author

RussKie commented Nov 15, 2024

@jeffkl, I could use some help. I can build it locally but somehow it stumbles on the CI.

@jeffkl
Copy link
Collaborator

jeffkl commented Nov 15, 2024

Okay I got everything working except a few tests which are throwing strange errors, almost like a behavioral difference in .NET 10, can you debug them @RussKie ?

@jeffkl
Copy link
Collaborator

jeffkl commented Nov 15, 2024

@RussKie never mind, I think I figured it out, new MSBuild has new APIs for parsing solutions 😢 I'll see if I can fix it...

@@ -11,6 +11,8 @@ variables:
BuildPlatform: 'Any CPU'
MSBuildArgs: '"/Property:Platform=$(BuildPlatform);Configuration=$(BuildConfiguration)" "/BinaryLogger:$(Build.SourcesDirectory)\$(ArtifactsDirectory)\msbuild.binlog"'
SignType: 'Real'
DotNet10InstallArgs: '-channel 10.0 -quality daily'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to use a specific early version, otherwise we'll get a repeat of #456 - i.e., a consumer may have an earlier version of .NET 10 installed than a version which was used to build the slngen tool.

@@ -7,6 +7,7 @@ variables:
BuildPlatform: 'Any CPU'
MSBuildArgs: '"/Property:Platform=$(BuildPlatform);Configuration=$(BuildConfiguration)"'
SignType: 'Test'
DotNet10InstallArgs: '-channel 10.0 -quality daily'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@RussKie
Copy link
Member Author

RussKie commented Nov 18, 2024

Thank you, @jeffkl!

@RussKie
Copy link
Member Author

RussKie commented Nov 18, 2024

I tested it locally against a dotnet/extensions's .NET 10 branch, and all worked as expected. This is good to merge.

@mruxmohan4
Copy link
Contributor

Thank you for your contribution!

@mruxmohan4 mruxmohan4 merged commit be73770 into microsoft:main Nov 19, 2024
5 checks passed
@RussKie RussKie deleted the support_net10 branch November 19, 2024 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants