nunit icon indicating copy to clipboard operation
nunit copied to clipboard

NET9 Support

Open Lachstec opened this issue 1 year ago • 8 comments

Changes that are needed in order to support .NET 9.0 #4846

Work in progress PR in order to prepare for the release of version 9.0.

Lachstec avatar Oct 01 '24 10:10 Lachstec

@dotnet-policy-service agree

Lachstec avatar Oct 01 '24 10:10 Lachstec

It looks like the linux build failed due to: terminate called after throwing an instance of 'PAL_SEHException' This is normally a "illegal pointed" which in managed code we should not have. We will revisit once .NET 9.0 is released.

manfred-brands avatar Oct 03 '24 06:10 manfred-brands

I think so to. I spent some time trying to figure out what the issue could be, but it is likely related to some internal things of .NET. Build is failing with the same exception on MacOS.

Lachstec avatar Oct 03 '24 08:10 Lachstec

I've tried rerunning the builds as RC2 was released this past Tuesday. The present state is all three builds (Windows, Linux, Mac) fail with the following error:

Error: /home/runner/work/nunit/nunit/src/NUnitFramework/windows-tests/obj/Release/net8.0-windows10.0.19041.0/WinRT.SourceGenerator/Generator.WinRTAotSourceGenerator/WinRTGlobalVtableLookup.g.cs(5,25): error CS0116: A namespace cannot directly contain members such as fields, methods or statements [/home/runner/work/nunit/nunit/src/NUnitFramework/windows-tests/windows-tests.csproj::TargetFramework=net8.0-windows10.0.19041.0]

We'll have to look into this

stevenaw avatar Oct 11 '24 00:10 stevenaw

I will look into it This Weekend. Thank you for trying with the new RC.

Lachstec avatar Oct 11 '24 04:10 Lachstec

This may actually be unrelated to .NET 9, and instead related related to a change in the latest version of the SDK.

There's a workaround listed here: https://github.com/dotnet/sdk/issues/44026

@Lachstec This fix may actually be better as a separate PR so that main can continue to build. We'd welcome a second PR here if you're interested, or I could put one up myself sometime this weekend if you can't.

stevenaw avatar Oct 12 '24 12:10 stevenaw

@stevenaw Thought so, as I already stumbled on this Issue while trying to fix the build. I will open a PR with the fix mentioned there in a minute.

Lachstec avatar Oct 12 '24 13:10 Lachstec

Tests are passing, so we should be good to go when version 9 drops.

Lachstec avatar Oct 13 '24 21:10 Lachstec

.NET 9 has launched today 🎉

@Lachstec The PR is listed as a Draft. Is it ready for review on your end? @manfred-brands you'd previously requested some changes here. Does it look alright to you now?

stevenaw avatar Nov 12 '24 21:11 stevenaw

CI fails because of formatting issues. Should I address them in a separate pr?

Lachstec avatar Nov 13 '24 10:11 Lachstec

CI fails because of formatting issues. Should I address them in a separate pr?

Ok, if the changes to the StaticProperty is because of the new net9.0 target, then leave it in (revert the revert)

manfred-brands avatar Nov 13 '24 10:11 manfred-brands

No problem, hope that it works out now ;)

Lachstec avatar Nov 14 '24 10:11 Lachstec

LGTM. Thanks for your contribution @Lachstec !

stevenaw avatar Nov 15 '24 02:11 stevenaw