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

Update to net9.0 #11000

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Update to net9.0 #11000

wants to merge 5 commits into from

Conversation

jjonescz
Copy link
Member

Doing this in roslyn (dotnet/roslyn#75465) and didn't want to leave razor behind.

Copy link
Member

@DustinCampbell DustinCampbell left a comment

Choose a reason for hiding this comment

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

Did you push this as a draft PR to claim 11,000? 😄

@@ -63,7 +63,6 @@
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="$(_MicrosoftExtensionsPackageVersion)" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="$(_MicrosoftExtensionsPackageVersion)" />
<PackageVersion Include="Microsoft.Extensions.FileSystemGlobbing" Version="$(_MicrosoftExtensionsPackageVersion)" />
<PackageVersion Include="Microsoft.Extensions.NonCapturingTimer.Sources" Version="5.0.0-preview.4.20205.1" />
Copy link
Member

Choose a reason for hiding this comment

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

Glad to see this go.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, this source package would need more warnings to be suppressed with net9 (I'm not yet sure why, but some existing IDE* error codes started newly being reported with net9.0). It seems better to just include the one source file from this source package directly and make it conform to our editorconfig. I also fixed up some missing file headers that got missed because of the IDE0073 being ignored previously.

Copy link
Member

Choose a reason for hiding this comment

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

It looks like this is only used in one place in the MS.VS.Razor.LegacyEditor proejct. Could you move this file there?

@@ -22,8 +24,15 @@ public CodeGenerationIntegrationTest(bool designTime = false)
: base(layer: TestProject.Layer.Compiler)
{
this.designTime = designTime;
BaseCompilation = BaseCompilation.AddReferences(
MetadataReference.CreateFromFile(typeof(TestTagHelperDescriptors).Assembly.Location));
Copy link
Member Author

Choose a reason for hiding this comment

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

This assembly reference started failing due to now being net9.0 but others (via Basic.Reference.Assemblies) being net8.0.

Refactoring of the following file (TestTagHelperDescriptors.cs) is related to this.

@@ -63,7 +63,6 @@
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="$(_MicrosoftExtensionsPackageVersion)" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="$(_MicrosoftExtensionsPackageVersion)" />
<PackageVersion Include="Microsoft.Extensions.FileSystemGlobbing" Version="$(_MicrosoftExtensionsPackageVersion)" />
<PackageVersion Include="Microsoft.Extensions.NonCapturingTimer.Sources" Version="5.0.0-preview.4.20205.1" />
Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, this source package would need more warnings to be suppressed with net9 (I'm not yet sure why, but some existing IDE* error codes started newly being reported with net9.0). It seems better to just include the one source file from this source package directly and make it conform to our editorconfig. I also fixed up some missing file headers that got missed because of the IDE0073 being ignored previously.

@@ -77,7 +77,7 @@
-->
<Otherwise>
<PropertyGroup>
<DefaultNetCoreTargetFramework>net8.0</DefaultNetCoreTargetFramework>
<DefaultNetCoreTargetFramework>net9.0</DefaultNetCoreTargetFramework>
Copy link
Member Author

@jjonescz jjonescz Oct 11, 2024

Choose a reason for hiding this comment

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

Hm, I guess it's not that simple, parts that deploy to VS/VSCode need to stay on net8.0. I will at least extract the independent parts of this PR for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

To make it more of a gradual change, you could add net9 to the multi-targeting, and we can continue to change it as the needs of SDK/VS/VSCode change. There are some tradeoffs to making the multi-targeting conditional to being on a CI machine or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants