Skip to content

Commit

Permalink
Disable SERIALIZABLE for net8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jstedfast committed Dec 10, 2023
1 parent 15e111e commit a2460cb
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 4 deletions.
4 changes: 2 additions & 2 deletions MailKit/MailKit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
<DebugType>full</DebugType>
</PropertyGroup>

<!-- Enable serializable support for net4.x, net6.0 and net8.0 -->
<PropertyGroup Condition=" ! $(TargetFramework.StartsWith('netstandard')) ">
<!-- Enable serializable support for net4.x and net6.0 -->
<PropertyGroup Condition=" $(TargetFramework.StartsWith('net4')) Or $(TargetFramework.StartsWith('net6')) ">
<DefineConstants>$(DefineConstants);SERIALIZABLE</DefineConstants>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions MailKit/MailKitLite.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
<DebugType>full</DebugType>
</PropertyGroup>

<!-- Enable serializable support for net4.x, net6.0 and net8.0 -->
<PropertyGroup Condition=" ! $(TargetFramework.StartsWith('netstandard')) ">
<!-- Enable serializable support for net4.x and net6.0 -->
<PropertyGroup Condition=" $(TargetFramework.StartsWith('net4')) Or $(TargetFramework.StartsWith('net6')) ">
<DefineConstants>$(DefineConstants);SERIALIZABLE</DefineConstants>
</PropertyGroup>

Expand Down
4 changes: 4 additions & 0 deletions UnitTests/ExceptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
// THE SOFTWARE.
//

#if NET6_0

using System.Runtime.Serialization.Formatters.Binary;

using MailKit;
Expand Down Expand Up @@ -342,3 +344,5 @@ public void TestPop3ProtocolException ()
}
}
}

#endif // NET6_0
4 changes: 4 additions & 0 deletions UnitTests/Net/Imap/ImapCommandExceptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
// THE SOFTWARE.
//

#if NET6_0

using System.Runtime.Serialization.Formatters.Binary;

using MailKit.Net.Imap;
Expand Down Expand Up @@ -73,3 +75,5 @@ public void TestImapCommandException ()
}
}
}

#endif // NET6_0
4 changes: 4 additions & 0 deletions UnitTests/Net/Pop3/Pop3CommandExceptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
// THE SOFTWARE.
//

#if NET6_0

using System.Runtime.Serialization.Formatters.Binary;

using MailKit.Net.Pop3;
Expand Down Expand Up @@ -94,3 +96,5 @@ public void TestPop3CommandException ()
}
}
}

#endif // NET6_0
4 changes: 4 additions & 0 deletions UnitTests/Net/Proxy/ProxyProtocolExceptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
// THE SOFTWARE.
//

#if NET6_0

using System.Runtime.Serialization.Formatters.Binary;

using MailKit.Net.Proxy;
Expand Down Expand Up @@ -70,3 +72,5 @@ public void TestSerialization ()
}
}
}

#endif // NET6_0
4 changes: 4 additions & 0 deletions UnitTests/Net/Smtp/SmtpCommandExceptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
// THE SOFTWARE.
//

#if NET6_0

using System.Runtime.Serialization.Formatters.Binary;

using MimeKit;
Expand Down Expand Up @@ -66,3 +68,5 @@ public void TestSmtpCommandException ()
}
}
}

#endif // NET6_0
4 changes: 4 additions & 0 deletions UnitTests/Net/Smtp/SmtpProtocolExceptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
// THE SOFTWARE.
//

#if NET6_0

using System.Runtime.Serialization.Formatters.Binary;

using MailKit.Net.Smtp;
Expand Down Expand Up @@ -70,3 +72,5 @@ public void TestSerialization ()
}
}
}

#endif // NET6_0
4 changes: 4 additions & 0 deletions UnitTests/Security/AuthenticationExceptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
// THE SOFTWARE.
//

#if NET6_0

using System.Runtime.Serialization.Formatters.Binary;

using MailKit.Security;
Expand Down Expand Up @@ -70,3 +72,5 @@ public void TestSerialization ()
}
}
}

#endif // NET6_0
3 changes: 3 additions & 0 deletions UnitTests/Security/SaslExceptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public void TestArgumentExceptions ()
Assert.Throws<ArgumentNullException> (() => new SaslException (null, SaslErrorCode.MissingChallenge, "message"));
}

#if NET6_0

[Test]
public void TestSerialization ()
{
Expand All @@ -54,5 +56,6 @@ public void TestSerialization ()
Assert.AreEqual (expected.ErrorCode, ex.ErrorCode, "Unexpected ErrorCode.");
}
}
#endif // NET6_0
}
}
4 changes: 4 additions & 0 deletions UnitTests/Security/SslHandshakeExceptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public class SslHandshakeExceptionTests
{
const string HelpLink = "https://github.com/jstedfast/MailKit/blob/master/FAQ.md#ssl-handshake-exception";

#if NET6_0

[Test]
public void TestSerialization ()
{
Expand Down Expand Up @@ -144,6 +146,8 @@ public void TestSerialization ()
}
}

#endif // NET6_0

class FakeClient : MailService
{
SslCertificateValidationInfo sslValidationInfo;
Expand Down

0 comments on commit a2460cb

Please sign in to comment.