Skip to content

Updating Framework Targets #690

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 11 additions & 34 deletions projects/client/RabbitMQ.Client/RabbitMQ.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<PropertyGroup>
<Description>The RabbitMQ .NET client is the official client library for C# (and, implicitly, other .NET languages)</Description>
<VersionPrefix>6.0.0</VersionPrefix>
<TargetFrameworks>net452;netstandard1.5;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand All @@ -16,7 +16,6 @@
<PackageIcon>icon.png</PackageIcon>
<PackageProjectUrl>https://www.rabbitmq.com/dotnet.html</PackageProjectUrl>
<PackageLicense>https://www.rabbitmq.com/dotnet.html</PackageLicense>
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50</PackageTargetFallback>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
Expand All @@ -30,20 +29,18 @@
<Compile Remove="build\**\*" />
<Compile Include="..\..\..\gensrc\autogenerated-api-0-9-1.cs" Exclude="build\**\*;bin\**;obj\**;**\*.xproj;packages\**" />
</ItemGroup>
<ItemGroup>
<None Include="icon.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' Or '$(TargetFramework)' == 'netstandard2.0' ">

<ItemGroup>
<None Include="icon.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<DefineConstants>$(DefineConstants);CORECLR</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.5'">
<DefineConstants>$(DefineConstants);CORECLR15</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'SignedRelease' ">
<DelaySign>true</DelaySign>
<OutputType>Library</OutputType>
Expand All @@ -52,27 +49,7 @@
<SignAssembly>true</SignAssembly>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' ">
<PackageReference Include="System.Collections.Concurrent" Version="4.3.0" />
<PackageReference Include="System.Console" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.Debug" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.Tracing" Version="4.3.0" />
<PackageReference Include="System.IO" Version="4.3.0" />
<PackageReference Include="System.Linq" Version="4.3.0" />
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
<PackageReference Include="System.Net.Security" Version="4.3.2" />
<PackageReference Include="System.Net.Sockets" Version="4.3.0" />
<PackageReference Include="System.Reflection.Extensions" Version="4.3.0" />
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" />
<PackageReference Include="System.Runtime" Version="4.3.0" />
<PackageReference Include="System.Runtime.Extensions" Version="4.3.0" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.0" />
<PackageReference Include="System.Threading" Version="4.3.0" />
<PackageReference Include="System.Threading.Thread" Version="4.3.0" />
<PackageReference Include="System.Threading.Timer" Version="4.3.0" />
</ItemGroup>

<ItemGroup>
<ItemGroup Condition="$('TargetFramework') == 'net462'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,8 @@
using System.Linq;
using System.Security.Authentication;

#if !NETFX_CORE

using System.Net.Security;

#endif

namespace RabbitMQ.Client
{
/// <summary>Main entry point to the RabbitMQ .NET AMQP client
Expand Down Expand Up @@ -551,9 +547,7 @@ private void SetUri(Uri uri)
{
Ssl.Enabled = true;
Ssl.Version = AmqpUriSslProtocols;
#if !(NETFX_CORE)
Ssl.AcceptablePolicyErrors = SslPolicyErrors.RemoteCertificateNameMismatch;
#endif
Port = AmqpTcpEndpoint.DefaultAmqpSslPort;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@
//---------------------------------------------------------------------------

using System;

#if NETFX_CORE
using Windows.Networking.Sockets;
#else
using System.Net.Sockets;
#endif

namespace RabbitMQ.Client
{
Expand All @@ -53,24 +48,8 @@ public class ConnectionFactoryBase
/// <summary>
/// Set custom socket options by providing a SocketFactory.
/// </summary>
#if NETFX_CORE
public Func<StreamSocket> SocketFactory = DefaultSocketFactory;
#else
public Func<AddressFamily, ITcpClient> SocketFactory = DefaultSocketFactory;
#endif

#if NETFX_CORE
/// <summary>
/// Creates a new instance of the <see cref="StreamSocket"/>.
/// </summary>
/// <returns>New instance of a <see cref="StreamSocket"/>.</returns>
public static StreamSocket DefaultSocketFactory()
{
StreamSocket tcpClient = new StreamSocket();
tcpClient.Control.NoDelay = true;
return tcpClient;
}
#else
/// <summary>
/// Creates a new instance of the <see cref="TcpClient"/>.
/// </summary>
Expand All @@ -84,6 +63,5 @@ public static ITcpClient DefaultSocketFactory(AddressFamily addressFamily)
};
return new TcpClientAdapter(socket);
}
#endif
}
}
6 changes: 0 additions & 6 deletions projects/client/RabbitMQ.Client/src/client/api/IProtocol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@

using System;

#if !NETFX_CORE
using System.Net.Sockets;
#else
using Windows.Networking.Sockets;
#endif

using RabbitMQ.Client.Impl;

namespace RabbitMQ.Client
Expand Down
6 changes: 1 addition & 5 deletions projects/client/RabbitMQ.Client/src/client/api/ITcpClient.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#if !NETFX_CORE
using System;
using System;
using System.Threading.Tasks;

using System.Net.Sockets;
using System.Threading;

namespace RabbitMQ.Client
{
Expand All @@ -26,4 +23,3 @@ public interface ITcpClient : IDisposable
void Close();
}
}
#endif
3 changes: 0 additions & 3 deletions projects/client/RabbitMQ.Client/src/client/api/SslHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
// Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
//---------------------------------------------------------------------------

#if !NETFX_CORE

using System;
using System.IO;
using System.Net.Security;
Expand Down Expand Up @@ -109,4 +107,3 @@ private bool CertificateValidationCallback(object sender, X509Certificate certif
}
}
}
#endif
18 changes: 0 additions & 18 deletions projects/client/RabbitMQ.Client/src/client/api/SslOption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,9 @@
//---------------------------------------------------------------------------


#if !NETFX_CORE
using System.Net.Security;
using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates;
#else
using Windows.Networking.Sockets;
#endif

namespace RabbitMQ.Client
{
Expand All @@ -54,28 +50,20 @@ namespace RabbitMQ.Client
/// </summary>
public class SslOption
{
#if !NETFX_CORE
private X509CertificateCollection _certificateCollection;
#endif

/// <summary>
/// Constructs an SslOption specifying both the server cannonical name and the client's certificate path.
/// </summary>
public SslOption(string serverName, string certificatePath = "", bool enabled = false)
{
#if !NETFX_CORE
Version = SslProtocols.Tls;
AcceptablePolicyErrors = SslPolicyErrors.None;
#endif

ServerName = serverName;
CertPath = certificatePath;
Enabled = enabled;

#if !NETFX_CORE
CertificateValidationCallback = null;
CertificateSelectionCallback = null;
#endif
}

/// <summary>
Expand All @@ -86,12 +74,10 @@ public SslOption()
{
}

#if !NETFX_CORE
/// <summary>
/// Retrieve or set the set of ssl policy errors that are deemed acceptable.
/// </summary>
public SslPolicyErrors AcceptablePolicyErrors { get; set; }
#endif

/// <summary>
/// Retrieve or set the path to client certificate.
Expand All @@ -103,7 +89,6 @@ public SslOption()
/// </summary>
public string CertPath { get; set; }

#if !NETFX_CORE
/// <summary>
/// An optional client specified SSL certificate selection callback. If this is not specified,
/// the first valid certificate found will be used.
Expand Down Expand Up @@ -148,7 +133,6 @@ public X509CertificateCollection Certs
/// </summary>
/// <remarks>Uses the built-in .NET mechanics for checking a certificate against CRLs.</remarks>
public bool CheckCertificateRevocation { get; set; }
#endif

/// <summary>
/// Flag specifying if Ssl should indeed be used.
Expand All @@ -161,11 +145,9 @@ public X509CertificateCollection Certs
/// </summary>
public string ServerName { get; set; }

#if !NETFX_CORE
/// <summary>
/// Retrieve or set the Ssl protocol version.
/// </summary>
public SslProtocols Version { get; set; }
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,6 @@ protected OperationInterruptedException(string message, Exception inner)
: base(message, inner)
{
}
/*
#if !(NETFX_CORE)
protected OperationInterruptedException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
#endif
*/

///<summary>Retrieves the explanation for the shutdown. May
///return null if no explanation is available.</summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,5 @@ protected RabbitMQClientException(string message, Exception innerException) : ba
{

}

/*
#if !(NETFX_CORE)
/// <summary>Initializes a new instance of the <see cref="RabbitMQClientException" /> class with serialized data.</summary>
/// <param name="info">The <see cref="System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown. </param>
/// <param name="context">The <see cref="System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination. </param>
/// <exception cref="System.ArgumentNullException">The <paramref name="info" /> parameter is null. </exception>
/// <exception cref="System.Runtime.Serialization.SerializationException">The class name is null or <see cref="System.Exception.HResult" /> is zero (0). </exception>
[System.Security.SecuritySafeCritical]
protected RabbitMQClientException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context)
{

}
#endif
*/
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,6 @@ public Command HandleFrame(InboundFrame f)
}
case AssemblyState.Complete:
default:
#if NETFX_CORE
Debug.WriteLine("Received frame in invalid state {0}; {1}", m_state, f);
#else
//Trace.Fail(string.Format("Received frame in invalid state {0}; {1}", m_state, f));
#endif
return null;
}
}
Expand Down
Loading