11 Commits

Author SHA1 Message Date
mus65 8cd6ad65b1 fix Build with newer .NET 10 SDKs (#1772)
* fix Build with newer .NET 10 SDKs

The IDE0370 are a mess since they only affect certain target frameworks.
Maybe we should disable this one completely instead?

Also set a fixed SDK Version in CI so this doesn't randomly break again.

* Remove IDE0370

* global.json: use latestMinor

to make sure that dotnet-setup installs the
exact version, see https://github.com/sshnet/SSH.NET/pull/1772#discussion_r2941495945

* Update global.json

Co-authored-by: Rob Hague <rob.hague00@gmail.com>

---------

Co-authored-by: Rob Hague <rob.hague00@gmail.com>
2026-03-16 19:31:32 +01:00
mus65 4e02502bdf Add .NET 10 target and make use of C#14 extension members (#1672)
* Add .NET 10 target

* fix IDE0031

https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0031

* fix ca5399

https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca5399

* fix ca1515

https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1515

* fix ca2002

https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2002

* fix ca1508

new false positives.

https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1508

* fix ca2000

https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2000

* fix ca2025

https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2025

* fix ca1849

https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1849

* fix Reverse() overloads

because of https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/10.0/csharp-overload-resolution

* supress CA2002

* Use extension members for ThrowHelpers

* use extension members for CryptoAbstractions

* use extension member for DateTime.UnixEpoch

* use extension members for string.Join etc

* use extension members for Convert.To/FromHexString

* disable CA1508

* Update .NET 10 RC2

* Workaround Build Regression in .NET 10 RC2

https://github.com/dotnet/sdk/issues/51265

* suppress new warnings introduced by merge

* Update to .NET 10 final release

* Revert "Workaround Build Regression in .NET 10 RC2"

This is fixed in the final release.

This reverts commit 5a59ac9aa8.

* fix new warnings with MSTest 4 + .NET 10

* use same Randomizer instance

* disable CA2000

* reduce CA1849 suppressions

and disable duplicate S6966

* disable preview analyzers

reverts 6c3c06d95a
2025-11-15 12:21:49 +01:00
dependabot[bot] 26bc749409 Bump dependencies (#1652)
---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rob Hague <rob.hague00@gmail.com>
2025-06-06 07:32:45 +02:00
dependabot[bot] 58eaeec226 Bump the dependencies (#1625)
* Bump the dependencies group with 5 updates

* use MEL 8.0.3

* use MSTest meta package

* revert Meziantou due to NRE

* add a more useful global.json and pin third party action

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rob Hague <rob.hague00@gmail.com>
2025-04-10 09:13:36 +02:00
mus65 02c30c88a9 Only enable TreatWarningsAsErrors in Release (#1624)
* Only enable TreatWarningsAsErrors in Release

* Remove global.json

this doesn't actually do anything useful like this.

* Also check CI

Co-authored-by: Rob Hague <rob.hague00@gmail.com>

---------

Co-authored-by: Rob Hague <rob.hague00@gmail.com>
2025-03-29 19:53:36 +01:00
mus65 752b1db8f0 Add .NET 9 target (#1480)
* Add .NET 9 target

* Disable SonarSource S3236

This following change in the runtime now causes this analyzer
to complain about some Debug.Assert calls which doesn't make sense.

https://github.com/dotnet/core/blob/main/release-notes/9.0/preview/preview7/libraries.md#debugassert-now-reports-assert-condition-by-default
https://rules.sonarsource.com/csharp/RSPEC-3236/

* make use of .NET 9 Lock type

see https://github.com/dotnet/runtime/issues/34812

* Define own Lock type to avoid ifdefs

* revert irrelevant style changes

* update global.json

* Keep net8.0 target in IntegrationTests

Co-authored-by: Rob Hague <rob.hague00@gmail.com>

* fix Package Downgrade Warning

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)

* update global.json to RC2

* update global.json to .NET 9 GA

* update GitHub Actions for .NET 9

---------

Co-authored-by: Rob Hague <rob.hague00@gmail.com>
2024-11-23 17:51:59 +01:00
Scott Xu 4c7bd35a71 Add support for .NET 8.0 (#1255)
* Add support for .NET 8.0

* Fix CA1512: Use 'ArgumentOutOfRangeException.ThrowIfNegative' instead of explicitly throwing a new exception instance (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1512)

* Use `ThrowIfGreaterThan` instead of `ThrowIfNegative`+calculation, to supply the correct parameter name.

* .NET 8 is faster :-)

* Use the explicit version, in case newer version SDK breaks our tests
2023-12-01 22:56:48 +01:00
Wojciech Nagórski d3641a0676 Test integration tests (#1250)
* Test integration tests

* Update appveyor.yml

* Update appveyor.yml

* Update Dockerfile

* Update appveyor.yml

* test?

* Test

* Enable docker

* Update appveyor.yml

* Update appveyor.yml

* Fix & Show additional information

* Try to fix connection problems

* Fix build

* remove artifacts

* Enable logging

* Log Information only

* Update appveyor.yml

Co-authored-by: Rob Hague <rob.hague00@gmail.com>

* Update appveyor.yml

* Update appveyor.yml

Co-authored-by: Rob Hague <rob.hague00@gmail.com>

* Update appveyor.yml

Co-authored-by: Rob Hague <rob.hague00@gmail.com>

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* sleep after restarting

* Update RemoteSshd.cs

* Fix tests

* Dispose ports

* Small improvements

* Fix build

* Small fixes

* Revert not related changes

* Test linux and windows

* fix

* test_script

* Use real commands

* Fixes

* fix?

* Add Appveyor TestLogger

* Fix linux tests

* Fix tests

* Try to fix tests

* Revert

* Give time before

* fix

* revert

* Give some time to process all messages after connect

* ForwardedPortDynamicTest_Stop_PortStarted_ChannelNotBound

* fix netsh

* trace

* Update appveyor.yml

* Update appveyor.yml

* etl2pcapng

* Update appveyor.yml

???

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* come on !!

* Update appveyor.yml

* Fixes tests for linux

* Reverts

* Fix build

* Update TestMethodForPlatformAttribute.cs

* Update TestMethodForPlatformAttribute.cs

* Update appveyor.yml

* Issue #1253

* Install .NET SDK

* next try

* fix?

* try

* Finishing

* Fixes

* apt-get install dotnet-sdk-7.0

* Finish?

* Add environment APPVEYOR_BAKE_IMAGE

* Update test/Renci.SshNet.Tests/Classes/Connection/DirectConnectorTest_Connect_TimeoutConnectingToServer.cs

Co-authored-by: Rob Hague <rob.hague00@gmail.com>

* Fix review

* Fix

* Update appveyor.yml

* Update appveyor.yml

* Delete .runsettings

---------

Co-authored-by: Rob Hague <rob.hague00@gmail.com>
Co-authored-by: Robert Hague <rh@johnstreetcapital.com>
Co-authored-by: Scott Xu <scott-xu@msn.com>
2023-11-30 19:19:00 +01:00
Rob Hague 58284d6019 Update global.json (#1240) 2023-11-16 06:05:37 +01:00
Gert Driesen 066f9982e3 Upgrade .NET SDK from 7.402 to 7.403. (#1222) 2023-10-25 08:35:44 +02:00
Wojciech Nagórski f1297dec75 Move test projects (#1212)
* Move test projects to test folder.
Move global.json to root of repo.
Update solution items in solution.

* Move test projects to test folder.
Move global.json to root of repo.
Update solution items in solution.
Update appveyor configuration/

* Attempt to have appveyor use the correct .NET SDK.

* Update .NET SDK to version 7.0.402.

* Move Data folder below Renci.SshNet.Tests.

* Make csinst less chatty.

* Move Data folder directly below test folder as it's used by multiple test projects.

* Remove CS1591 nowarn from concrete test projects as this is already defined in the Directory.Build.props that is in the test folder.

* Fix integration test after moving test projects

---------

Co-authored-by: drieseng <gert.driesen@telenet.be>
2023-10-14 22:16:11 +02:00