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 .NET 9 target #1480

Draft
wants to merge 15 commits into
base: develop
Choose a base branch
from
Draft

Add .NET 9 target #1480

wants to merge 15 commits into from

Conversation

mus65
Copy link
Contributor

@mus65 mus65 commented Aug 30, 2024

I had to disable a SonarSource analyzer and made use of the new Lock type, see separate Commits.

CI is expected to fail because of missing .NET 9 binaries in AppVeyor. Build and tests pass locally.

Can be merged when .NET 9 final is released and AppVeyor supports it.

@Rob-Hague
Copy link
Collaborator

Can we have a basic Lock polyfill to save on the #ifdefs? e.g.

#if !NET9_0_OR_GREATER

namespace Renci.SshNet.Common;

internal sealed class Lock
{
    public bool TryEnter() => Monitor.TryEnter(this);
    public void Exit() => Monitor.Exit(this);
}

@mus65
Copy link
Contributor Author

mus65 commented Aug 31, 2024

Makes sense, pushed.

@drieseng
Copy link
Member

@mus65, you'll also want to update global.json.

@drieseng
Copy link
Member

@Rob-Hague, are planning on merging this before the release of .NET 9.0? In theory, there may even be API changes - I'm thinking of the Lock class - between now and the release. It's highly unlikely though.

@mus65
Copy link
Contributor Author

mus65 commented Sep 14, 2024

@drieseng @Rob-Hague I updated global.json . I had to reference RC1 explicitly though, so I have to change it when final is released.

I left it a draft because it's still preview and wouldn't expect it to be merged before .NET 9 final. RC1 is already released, so I wouldn't expect any more API changes.

@Rob-Hague
Copy link
Collaborator

Yeah, we will merge once .NET 9 is released

Newer targets can be used on appveyor with apt-get, as in the opposite of #1352

for some reason this happens starting with .NET 9.0 RC2:

/home/mus/git/SSH.NET/test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj : error NU1605:
      Warning As Error: Detected package downgrade: BouncyCastle.Cryptography from 2.4.0 to 2.3.1. Reference the package directly from the project to select a different version.
       Renci.SshNet.IntegrationTests -> SSH.NET 1.0.0 -> BouncyCastle.Cryptography (>= 2.4.0)
       Renci.SshNet.IntegrationTests -> Testcontainers 3.10.0 -> BouncyCastle.Cryptography (>= 2.3.1)
@mus65
Copy link
Contributor Author

mus65 commented Nov 13, 2024

This is now only blocked by AppVeyor not supporting .NET 9. apt-get is not going work either because the dotnet9 package is not available in Ubuntu 22.04 (see https://launchpad.net/ubuntu/+source/dotnet9 ).

@Rob-Hague has there been any thought about moving to GitHub actions?

@Rob-Hague
Copy link
Collaborator

I seem to remember @WojciechNagorski trying it but I can't find a PR so may be imagining

@Rob-Hague
Copy link
Collaborator

Feel free to give a go though

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