Skip to content

Commit

Permalink
Add Net9.0 to wcf client test and supress warnings due to the change. (
Browse files Browse the repository at this point in the history
  • Loading branch information
imcarolwang authored Nov 13, 2024
1 parent 506ae2b commit c4b6700
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
</ItemGroup>

<PropertyGroup>
<ScenarioTestTargetFrameworks>net8.0</ScenarioTestTargetFrameworks>
<UnitTestTargetFrameworks>net8.0</UnitTestTargetFrameworks>
<ScenarioTestTargetFrameworks>net8.0;net9.0</ScenarioTestTargetFrameworks>
<UnitTestTargetFrameworks>net8.0;net9.0</UnitTestTargetFrameworks>
<!-- This is the target framework version of the built tests picked up to send to Helix -->
<XUnitPublishTargetFramework>net8.0</XUnitPublishTargetFramework>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ public static void BasicHttp_Async_Close_Proxy_WithSingleThreadedSyncContext()

private static string StreamToString(Stream stream)
{
stream.Read(Array.Empty<byte>(), 0, 0);
stream.ReadExactly(Array.Empty<byte>(), 0, 0);
var reader = new StreamReader(stream, Encoding.UTF8);
return reader.ReadToEnd();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ public static void DirectlySettingCertificateCredential()
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
var factory = new ChannelFactory<IWcfService>(binding, new EndpointAddress(FakeAddress.HttpsAddress));
byte[] certificateBytes = Convert.FromBase64String(BasicHttpsBindingTest.AUserCertificate);
#pragma warning disable SYSLIB0057
var certificate = new X509Certificate2(certificateBytes);
#pragma warning restore SYSLIB0057
factory.Credentials.ClientCertificate.Certificate = certificate;
var channel = factory.CreateChannel();
Assert.Throws<PlatformNotSupportedException>(() => channel.Echo("hello"));
Expand Down

0 comments on commit c4b6700

Please sign in to comment.