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

Add agent for .NET 9.0 to the version 3 build #1602

Closed
Tracked by #1629
CharliePoole opened this issue Jan 18, 2025 · 12 comments · Fixed by #1642 or #1643
Closed
Tracked by #1629

Add agent for .NET 9.0 to the version 3 build #1602

CharliePoole opened this issue Jan 18, 2025 · 12 comments · Fixed by #1642 or #1643
Assignees
Labels
Milestone

Comments

@CharliePoole
Copy link
Member

This can be done soon and released with version 3.20.

@CharliePoole CharliePoole self-assigned this Jan 18, 2025
@CharliePoole CharliePoole added this to the 3.20.0 milestone Jan 18, 2025
@CharliePoole CharliePoole removed their assignment Jan 26, 2025
@mikkelbu
Copy link
Member

mikkelbu commented Mar 1, 2025

@CharliePoole Can this be done now? (as I think I've some bandwidth this weekend)

@CharliePoole
Copy link
Member Author

That would be great! In case you were not aware, we're still using main for version 3.

Up to you to decide whether any dependencies ought to be built for 9.0 as well.

@alex-nicholas
Copy link

Would this have anything to do with me being unable to use the nunit3-consolerunner to run tests targeting .NET 9.0

I've been getting about 50k 'Could not load file or assembly 'System.Runtime, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.' errors when I attempt to use the consolerunner to run my test suite, It runs fine through VS when targeting .NET 9.0, and it runs fine through nunit3-consolerunner if I target .NET 8.0.

Could not load file or assembly 'System.Runtime, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

Run Settings
    DisposeRunners: True
    WorkDirectory: C:\devsource
    DebugTests: True
    NumberOfTestWorkers: 0
    ImageRuntimeVersion: 4.0.30319
    ImageTargetFrameworkName: .NETCoreApp,Version=v9.0
    ImageRequiresX86: False
    ImageRequiresDefaultAppDomainAssemblyResolver: False
    TargetRuntimeFramework: netcore-9.0

Test Run Summary
  Overall result: Failed
  Test Count: 0, Passed: 0, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
  Start time: 2025-03-12 01:20:51Z
    End time: 2025-03-12 01:21:28Z
    Duration: 36.823 seconds

@CharliePoole
Copy link
Member Author

@alex-nicholas Yes, that's the case. @mikkelbu Did you make any progress on this?

@mikkelbu
Copy link
Member

@CharliePoole Unfortunately, I've been quite busy the last couple of weeks, but I had time to look at this tonight, so now there is a PR (I've yet to test it manually)

@CharliePoole
Copy link
Member Author

Looks like my review and your comment here crossed. Since it's time for you to sleep, I'll add the tests. :--)

@CharliePoole
Copy link
Member Author

@alex-nicholas As you can see above, this is built (and available) but not yet tested. I'll be adding automated tests but it would be great if you could run it through its paces. See https://www.myget.org/feed/nunit/package/nuget/NUnit.ConsoleRunner/3.19.3-alpha.8

@CharliePoole
Copy link
Member Author

@mikkelbu @alex-nicholas

I was premature. It doesn't actually work if you try to communicate with the net.9.0 agent. Primary reason is binaryformatter, which I scheduled for removal in V4 but which is not present in .net 9.0. That's my bad for mis-scheduling the changes.

Ideal solution: replace binaryformatter in 3.20. This is obviously non-trivial. The workaround is to use the System.Runtime.Serialization.Formatters package.

Of course, we're already using this unsafe formatter for .NET 8.0, where Microsoft made it a bit easier to keep using it. My thought is to add the package, so we can test under .NET 9.0.

If we can replace BinaryFormatter in the next few weeks, I'm inclined to do it for 3.20. But if it seems to be too big a job, we can continue to plan on doing it for 4.0.

@nunit/engine-team What do you think?

Reopening this for furthere work. @mikkelbu If you do find more time, we can both work on this.

@manfred-brands
Copy link
Member

MS makes it too easy to keep that "dangerous" BinaryFormatter.
They marked it obsolete in .NET7, but people can disable warnings.
They disabled it in .NET8, but allowed the functionality to be restored with
Then they removed in .NET9, but then supply a nuget package to get it all back.
It will never die.

For 3.20, that nuget package might do the trick.

@CharliePoole
Copy link
Member Author

Yup. And we've taken each of those steps one by one. :-)

Seems to be working now. Lots of busy work to incorporate the package, the dependent assembly containing our tcp protocol had to be built with 9.0 in addition to the agent, in order to keep things separated.

@CharliePoole
Copy link
Member Author

Reopening this to add the fix.

@CharliePoole
Copy link
Member Author

@alex-nicholas Corrected build is on our myget feed as version 3.20.0-alpha.1.

https://www.myget.org/feed/nunit/package/nuget/NUnit.ConsoleRunner/3.20.0-alpha.1

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