Handle ifdefs

This commit is contained in:
Ryan Brandenburg 2018-05-08 12:00:27 -07:00
parent 3095b86da1
commit bb70e7077f
2 changed files with 5 additions and 7 deletions

View File

@ -136,10 +136,8 @@ namespace Microsoft.AspNetCore.WebSockets.ConformanceTest.Autobahn
var appPath = Helpers.GetApplicationPath("AutobahnTestApp");
var configPath = Path.Combine(Directory.GetCurrentDirectory(), "..", "..", "..", "Http.config");
var targetFramework =
#if NETCOREAPP2_1
"netcoreapp2.1";
#elif NETCOREAPP2_0
"netcoreapp2.0";
#if NETCOREAPP2_2
"netcoreapp2.2";
#else
#error Target frameworks need to be updated
#endif
@ -160,7 +158,7 @@ namespace Microsoft.AspNetCore.WebSockets.ConformanceTest.Autobahn
cancellationToken.ThrowIfCancellationRequested();
var handler = new HttpClientHandler();
// Win7 HttpClient on NetCoreApp2.1 defaults to TLS 1.0 and won't connect to Kestrel. https://github.com/dotnet/corefx/issues/28733
// Win7 HttpClient on NetCoreApp2.2 defaults to TLS 1.0 and won't connect to Kestrel. https://github.com/dotnet/corefx/issues/28733
// Mac HttpClient on NetCoreApp2.0 doesn't alow you to set some combinations.
// https://github.com/dotnet/corefx/blob/586cffcdfdf23ad6c193a4bf37fce88a1bf69508/src/System.Net.Http/src/System/Net/Http/CurlHandler/CurlHandler.SslProvider.OSX.cs#L104-L106
handler.SslProtocols = SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls;

View File

@ -13,10 +13,10 @@ using Xunit.Abstractions;
namespace Microsoft.AspNetCore.WebSockets.Test
{
#if NET461 || NETCOREAPP2_0
#if NET461
// ClientWebSocket does not support WebSockets on these platforms and OS. Kestrel does support it.
[OSSkipCondition(OperatingSystems.Windows, WindowsVersions.Win7, SkipReason = "No WebSockets Client for this platform")]
#elif NETCOREAPP2_1
#elif NETCOREAPP2_2
// ClientWebSocket has added support for WebSockets on Win7.
#else
#error Unknown TFM