Skip to content

Commit e66a032

Browse files
authored
Remove feature binary serialization (#1325)
* Drop RIPEMD160 * Replace FEATURE_BINARY_SERIALIZATION with NETFRAMEWORK
1 parent c044fd4 commit e66a032

13 files changed

+62
-66
lines changed

src/Renci.SshNet/Common/NetConfServerException.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
using System;
2-
#if FEATURE_BINARY_SERIALIZATION
2+
#if NETFRAMEWORK
33
using System.Runtime.Serialization;
4-
#endif // FEATURE_BINARY_SERIALIZATION
4+
#endif // NETFRAMEWORK
55

66
namespace Renci.SshNet.Common
77
{
88
/// <summary>
99
/// The exception that is thrown when there is something wrong with the server capabilities.
1010
/// </summary>
11-
#if FEATURE_BINARY_SERIALIZATION
11+
#if NETFRAMEWORK
1212
[Serializable]
13-
#endif // FEATURE_BINARY_SERIALIZATION
13+
#endif // NETFRAMEWORK
1414
public class NetConfServerException : SshException
1515
{
1616
/// <summary>
@@ -39,7 +39,7 @@ public NetConfServerException(string message, Exception innerException)
3939
{
4040
}
4141

42-
#if FEATURE_BINARY_SERIALIZATION
42+
#if NETFRAMEWORK
4343
/// <summary>
4444
/// Initializes a new instance of the <see cref="NetConfServerException"/> class.
4545
/// </summary>
@@ -51,6 +51,6 @@ protected NetConfServerException(SerializationInfo info, StreamingContext contex
5151
: base(info, context)
5252
{
5353
}
54-
#endif // FEATURE_BINARY_SERIALIZATION
54+
#endif // NETFRAMEWORK
5555
}
5656
}

src/Renci.SshNet/Common/ProxyException.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
using System;
2-
#if FEATURE_BINARY_SERIALIZATION
2+
#if NETFRAMEWORK
33
using System.Runtime.Serialization;
4-
#endif // FEATURE_BINARY_SERIALIZATION
4+
#endif // NETFRAMEWORK
55

66
namespace Renci.SshNet.Common
77
{
88
/// <summary>
99
/// The exception that is thrown when a proxy connection cannot be established.
1010
/// </summary>
11-
#if FEATURE_BINARY_SERIALIZATION
11+
#if NETFRAMEWORK
1212
[Serializable]
13-
#endif // FEATURE_BINARY_SERIALIZATION
13+
#endif // NETFRAMEWORK
1414
public class ProxyException : SshException
1515
{
1616
/// <summary>
@@ -39,7 +39,7 @@ public ProxyException(string message, Exception innerException)
3939
{
4040
}
4141

42-
#if FEATURE_BINARY_SERIALIZATION
42+
#if NETFRAMEWORK
4343
/// <summary>
4444
/// Initializes a new instance of the <see cref="ProxyException"/> class.
4545
/// </summary>
@@ -51,6 +51,6 @@ protected ProxyException(SerializationInfo info, StreamingContext context)
5151
: base(info, context)
5252
{
5353
}
54-
#endif // FEATURE_BINARY_SERIALIZATION
54+
#endif // NETFRAMEWORK
5555
}
5656
}

src/Renci.SshNet/Common/ScpException.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
using System;
2-
#if FEATURE_BINARY_SERIALIZATION
2+
#if NETFRAMEWORK
33
using System.Runtime.Serialization;
4-
#endif // FEATURE_BINARY_SERIALIZATION
4+
#endif // NETFRAMEWORK
55

66
namespace Renci.SshNet.Common
77
{
88
/// <summary>
99
/// The exception that is thrown when SCP error occurred.
1010
/// </summary>
11-
#if FEATURE_BINARY_SERIALIZATION
11+
#if NETFRAMEWORK
1212
[Serializable]
13-
#endif // FEATURE_BINARY_SERIALIZATION
13+
#endif // NETFRAMEWORK
1414
public class ScpException : SshException
1515
{
1616
/// <summary>
@@ -39,7 +39,7 @@ public ScpException(string message, Exception innerException)
3939
{
4040
}
4141

42-
#if FEATURE_BINARY_SERIALIZATION
42+
#if NETFRAMEWORK
4343
/// <summary>
4444
/// Initializes a new instance of the <see cref="ScpException"/> class.
4545
/// </summary>
@@ -51,6 +51,6 @@ protected ScpException(SerializationInfo info, StreamingContext context)
5151
: base(info, context)
5252
{
5353
}
54-
#endif // FEATURE_BINARY_SERIALIZATION
54+
#endif // NETFRAMEWORK
5555
}
5656
}

src/Renci.SshNet/Common/SftpPathNotFoundException.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
using System;
2-
#if FEATURE_BINARY_SERIALIZATION
2+
#if NETFRAMEWORK
33
using System.Runtime.Serialization;
4-
#endif // FEATURE_BINARY_SERIALIZATION
4+
#endif // NETFRAMEWORK
55

66
namespace Renci.SshNet.Common
77
{
88
/// <summary>
99
/// The exception that is thrown when file or directory is not found.
1010
/// </summary>
11-
#if FEATURE_BINARY_SERIALIZATION
11+
#if NETFRAMEWORK
1212
[Serializable]
13-
#endif // FEATURE_BINARY_SERIALIZATION
13+
#endif // NETFRAMEWORK
1414
public class SftpPathNotFoundException : SshException
1515
{
1616
/// <summary>
@@ -39,7 +39,7 @@ public SftpPathNotFoundException(string message, Exception innerException)
3939
{
4040
}
4141

42-
#if FEATURE_BINARY_SERIALIZATION
42+
#if NETFRAMEWORK
4343
/// <summary>
4444
/// Initializes a new instance of the <see cref="SftpPathNotFoundException"/> class.
4545
/// </summary>
@@ -51,6 +51,6 @@ protected SftpPathNotFoundException(SerializationInfo info, StreamingContext con
5151
: base(info, context)
5252
{
5353
}
54-
#endif // FEATURE_BINARY_SERIALIZATION
54+
#endif // NETFRAMEWORK
5555
}
5656
}

src/Renci.SshNet/Common/SftpPermissionDeniedException.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
using System;
2-
#if FEATURE_BINARY_SERIALIZATION
2+
#if NETFRAMEWORK
33
using System.Runtime.Serialization;
4-
#endif // FEATURE_BINARY_SERIALIZATION
4+
#endif // NETFRAMEWORK
55

66
namespace Renci.SshNet.Common
77
{
88
/// <summary>
99
/// The exception that is thrown when operation permission is denied.
1010
/// </summary>
11-
#if FEATURE_BINARY_SERIALIZATION
11+
#if NETFRAMEWORK
1212
[Serializable]
13-
#endif // FEATURE_BINARY_SERIALIZATION
13+
#endif // NETFRAMEWORK
1414
public class SftpPermissionDeniedException : SshException
1515
{
1616
/// <summary>
@@ -39,7 +39,7 @@ public SftpPermissionDeniedException(string message, Exception innerException)
3939
{
4040
}
4141

42-
#if FEATURE_BINARY_SERIALIZATION
42+
#if NETFRAMEWORK
4343
/// <summary>
4444
/// Initializes a new instance of the <see cref="SftpPermissionDeniedException"/> class.
4545
/// </summary>
@@ -51,6 +51,6 @@ protected SftpPermissionDeniedException(SerializationInfo info, StreamingContext
5151
: base(info, context)
5252
{
5353
}
54-
#endif // FEATURE_BINARY_SERIALIZATION
54+
#endif // NETFRAMEWORK
5555
}
5656
}

src/Renci.SshNet/Common/SshAuthenticationException.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
using System;
2-
#if FEATURE_BINARY_SERIALIZATION
2+
#if NETFRAMEWORK
33
using System.Runtime.Serialization;
4-
#endif // FEATURE_BINARY_SERIALIZATION
4+
#endif // NETFRAMEWORK
55

66
namespace Renci.SshNet.Common
77
{
88
/// <summary>
99
/// The exception that is thrown when authentication failed.
1010
/// </summary>
11-
#if FEATURE_BINARY_SERIALIZATION
11+
#if NETFRAMEWORK
1212
[Serializable]
13-
#endif // FEATURE_BINARY_SERIALIZATION
13+
#endif // NETFRAMEWORK
1414
public class SshAuthenticationException : SshException
1515
{
1616
/// <summary>
@@ -39,7 +39,7 @@ public SshAuthenticationException(string message, Exception innerException)
3939
{
4040
}
4141

42-
#if FEATURE_BINARY_SERIALIZATION
42+
#if NETFRAMEWORK
4343
/// <summary>
4444
/// Initializes a new instance of the <see cref="SshAuthenticationException"/> class.
4545
/// </summary>
@@ -51,6 +51,6 @@ protected SshAuthenticationException(SerializationInfo info, StreamingContext co
5151
: base(info, context)
5252
{
5353
}
54-
#endif // FEATURE_BINARY_SERIALIZATION
54+
#endif // NETFRAMEWORK
5555
}
5656
}

src/Renci.SshNet/Common/SshConnectionException.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
using System;
2-
#if FEATURE_BINARY_SERIALIZATION
2+
#if NETFRAMEWORK
33
using System.Runtime.Serialization;
4-
#endif // FEATURE_BINARY_SERIALIZATION
4+
#endif // NETFRAMEWORK
55
using Renci.SshNet.Messages.Transport;
66

77
namespace Renci.SshNet.Common
88
{
99
/// <summary>
1010
/// The exception that is thrown when connection was terminated.
1111
/// </summary>
12-
#if FEATURE_BINARY_SERIALIZATION
12+
#if NETFRAMEWORK
1313
[Serializable]
14-
#endif // FEATURE_BINARY_SERIALIZATION
14+
#endif // NETFRAMEWORK
1515
public class SshConnectionException : SshException
1616
{
1717
/// <summary>
@@ -70,7 +70,7 @@ public SshConnectionException(string message, DisconnectReason disconnectReasonC
7070
DisconnectReason = disconnectReasonCode;
7171
}
7272

73-
#if FEATURE_BINARY_SERIALIZATION
73+
#if NETFRAMEWORK
7474
/// <summary>
7575
/// Initializes a new instance of the <see cref="SshConnectionException"/> class.
7676
/// </summary>
@@ -82,6 +82,6 @@ protected SshConnectionException(SerializationInfo info, StreamingContext contex
8282
: base(info, context)
8383
{
8484
}
85-
#endif // FEATURE_BINARY_SERIALIZATION
85+
#endif // NETFRAMEWORK
8686
}
8787
}

src/Renci.SshNet/Common/SshException.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
using System;
2-
#if FEATURE_BINARY_SERIALIZATION
2+
#if NETFRAMEWORK
33
using System.Runtime.Serialization;
4-
#endif // FEATURE_BINARY_SERIALIZATION
4+
#endif // NETFRAMEWORK
55

66
namespace Renci.SshNet.Common
77
{
88
/// <summary>
99
/// The exception that is thrown when SSH exception occurs.
1010
/// </summary>
11-
#if FEATURE_BINARY_SERIALIZATION
11+
#if NETFRAMEWORK
1212
[Serializable]
13-
#endif // FEATURE_BINARY_SERIALIZATION
13+
#endif // NETFRAMEWORK
1414
public class SshException : Exception
1515
{
1616
/// <summary>
@@ -39,7 +39,7 @@ public SshException(string message, Exception inner)
3939
{
4040
}
4141

42-
#if FEATURE_BINARY_SERIALIZATION
42+
#if NETFRAMEWORK
4343
/// <summary>
4444
/// Initializes a new instance of the <see cref="SshException"/> class.
4545
/// </summary>
@@ -51,6 +51,6 @@ protected SshException(SerializationInfo info, StreamingContext context)
5151
: base(info, context)
5252
{
5353
}
54-
#endif // FEATURE_BINARY_SERIALIZATION
54+
#endif // NETFRAMEWORK
5555
}
5656
}

src/Renci.SshNet/Common/SshOperationTimeoutException.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
using System;
2-
#if FEATURE_BINARY_SERIALIZATION
2+
#if NETFRAMEWORK
33
using System.Runtime.Serialization;
4-
#endif // FEATURE_BINARY_SERIALIZATION
4+
#endif // NETFRAMEWORK
55

66
namespace Renci.SshNet.Common
77
{
88
/// <summary>
99
/// The exception that is thrown when operation is timed out.
1010
/// </summary>
11-
#if FEATURE_BINARY_SERIALIZATION
11+
#if NETFRAMEWORK
1212
[Serializable]
13-
#endif // FEATURE_BINARY_SERIALIZATION
13+
#endif // NETFRAMEWORK
1414
public class SshOperationTimeoutException : SshException
1515
{
1616
/// <summary>
@@ -39,7 +39,7 @@ public SshOperationTimeoutException(string message, Exception innerException)
3939
{
4040
}
4141

42-
#if FEATURE_BINARY_SERIALIZATION
42+
#if NETFRAMEWORK
4343
/// <summary>
4444
/// Initializes a new instance of the <see cref="SshOperationTimeoutException"/> class.
4545
/// </summary>
@@ -51,6 +51,6 @@ protected SshOperationTimeoutException(SerializationInfo info, StreamingContext
5151
: base(info, context)
5252
{
5353
}
54-
#endif // FEATURE_BINARY_SERIALIZATION
54+
#endif // NETFRAMEWORK
5555
}
5656
}

src/Renci.SshNet/Common/SshPassPhraseNullOrEmptyException.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
using System;
2-
#if FEATURE_BINARY_SERIALIZATION
2+
#if NETFRAMEWORK
33
using System.Runtime.Serialization;
4-
#endif // FEATURE_BINARY_SERIALIZATION
4+
#endif // NETFRAMEWORK
55

66
namespace Renci.SshNet.Common
77
{
88
/// <summary>
99
/// The exception that is thrown when pass phrase for key file is empty or <see langword="null"/>.
1010
/// </summary>
11-
#if FEATURE_BINARY_SERIALIZATION
11+
#if NETFRAMEWORK
1212
[Serializable]
13-
#endif // FEATURE_BINARY_SERIALIZATION
13+
#endif // NETFRAMEWORK
1414
public class SshPassPhraseNullOrEmptyException : SshException
1515
{
1616
/// <summary>
@@ -39,7 +39,7 @@ public SshPassPhraseNullOrEmptyException(string message, Exception innerExceptio
3939
{
4040
}
4141

42-
#if FEATURE_BINARY_SERIALIZATION
42+
#if NETFRAMEWORK
4343
/// <summary>
4444
/// Initializes a new instance of the <see cref="SshPassPhraseNullOrEmptyException"/> class.
4545
/// </summary>
@@ -51,6 +51,6 @@ protected SshPassPhraseNullOrEmptyException(SerializationInfo info, StreamingCon
5151
: base(info, context)
5252
{
5353
}
54-
#endif // FEATURE_BINARY_SERIALIZATION
54+
#endif // NETFRAMEWORK
5555
}
5656
}

src/Renci.SshNet/Renci.SshNet.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929
<EnableAotAnalyzer>true</EnableAotAnalyzer>
3030
</PropertyGroup>
3131

32-
<PropertyGroup Condition=" '$(TargetFramework)' == 'net462' ">
33-
<DefineConstants>$(DefineConstants);FEATURE_BINARY_SERIALIZATION</DefineConstants>
34-
</PropertyGroup>
35-
3632
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'netstandard2.0' ">
3733
<!-- Must be kept at version 1.0.0 or higher, see https://github.com/sshnet/SSH.NET/pull/1288 for details. -->
3834
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="[1.0.0,)" />

0 commit comments

Comments
 (0)