Skip to content

Commit c4b6700

Browse files
authored
Add Net9.0 to wcf client test and supress warnings due to the change. (#5666)
1 parent 506ae2b commit c4b6700

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
</ItemGroup>
4242

4343
<PropertyGroup>
44-
<ScenarioTestTargetFrameworks>net8.0</ScenarioTestTargetFrameworks>
45-
<UnitTestTargetFrameworks>net8.0</UnitTestTargetFrameworks>
44+
<ScenarioTestTargetFrameworks>net8.0;net9.0</ScenarioTestTargetFrameworks>
45+
<UnitTestTargetFrameworks>net8.0;net9.0</UnitTestTargetFrameworks>
4646
<!-- This is the target framework version of the built tests picked up to send to Helix -->
4747
<XUnitPublishTargetFramework>net8.0</XUnitPublishTargetFramework>
4848
</PropertyGroup>

src/System.Private.ServiceModel/tests/Scenarios/Contract/Service/ServiceContractTests.4.0.0.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ public static void BasicHttp_Async_Close_Proxy_WithSingleThreadedSyncContext()
495495

496496
private static string StreamToString(Stream stream)
497497
{
498-
stream.Read(Array.Empty<byte>(), 0, 0);
498+
stream.ReadExactly(Array.Empty<byte>(), 0, 0);
499499
var reader = new StreamReader(stream, Encoding.UTF8);
500500
return reader.ReadToEnd();
501501
}

src/System.ServiceModel.Http/tests/ServiceModel/BasicHttpsBindingTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ public static void DirectlySettingCertificateCredential()
7171
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
7272
var factory = new ChannelFactory<IWcfService>(binding, new EndpointAddress(FakeAddress.HttpsAddress));
7373
byte[] certificateBytes = Convert.FromBase64String(BasicHttpsBindingTest.AUserCertificate);
74+
#pragma warning disable SYSLIB0057
7475
var certificate = new X509Certificate2(certificateBytes);
76+
#pragma warning restore SYSLIB0057
7577
factory.Credentials.ClientCertificate.Certificate = certificate;
7678
var channel = factory.CreateChannel();
7779
Assert.Throws<PlatformNotSupportedException>(() => channel.Echo("hello"));

0 commit comments

Comments
 (0)