Skip to content

Commit 6b14316

Browse files
Merge pull request #690 from stebet/frameworkTargets
Updating Framework Targets
2 parents 9a25efa + 311ef63 commit 6b14316

27 files changed

+14
-361
lines changed

projects/client/RabbitMQ.Client/RabbitMQ.Client.csproj

Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<PropertyGroup>
77
<Description>The RabbitMQ .NET client is the official client library for C# (and, implicitly, other .NET languages)</Description>
88
<VersionPrefix>6.0.0</VersionPrefix>
9-
<TargetFrameworks>net452;netstandard1.5;netstandard2.0</TargetFrameworks>
9+
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
1010
<NoWarn>$(NoWarn);CS1591</NoWarn>
1111
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
1212
<GenerateDocumentationFile>true</GenerateDocumentationFile>
@@ -16,7 +16,6 @@
1616
<PackageIcon>icon.png</PackageIcon>
1717
<PackageProjectUrl>https://www.rabbitmq.com/dotnet.html</PackageProjectUrl>
1818
<PackageLicense>https://www.rabbitmq.com/dotnet.html</PackageLicense>
19-
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.5' ">$(PackageTargetFallback);dnxcore50</PackageTargetFallback>
2019
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
2120
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
2221
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
@@ -30,20 +29,18 @@
3029
<Compile Remove="build\**\*" />
3130
<Compile Include="..\..\..\gensrc\autogenerated-api-0-9-1.cs" Exclude="build\**\*;bin\**;obj\**;**\*.xproj;packages\**" />
3231
</ItemGroup>
33-
<ItemGroup>
34-
<None Include="icon.png">
35-
<Pack>True</Pack>
36-
<PackagePath></PackagePath>
37-
</None>
38-
</ItemGroup>
39-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' Or '$(TargetFramework)' == 'netstandard2.0' ">
32+
33+
<ItemGroup>
34+
<None Include="icon.png">
35+
<Pack>True</Pack>
36+
<PackagePath></PackagePath>
37+
</None>
38+
</ItemGroup>
39+
40+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
4041
<DefineConstants>$(DefineConstants);CORECLR</DefineConstants>
4142
</PropertyGroup>
4243

43-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.5'">
44-
<DefineConstants>$(DefineConstants);CORECLR15</DefineConstants>
45-
</PropertyGroup>
46-
4744
<PropertyGroup Condition=" '$(Configuration)' == 'SignedRelease' ">
4845
<DelaySign>true</DelaySign>
4946
<OutputType>Library</OutputType>
@@ -52,27 +49,7 @@
5249
<SignAssembly>true</SignAssembly>
5350
</PropertyGroup>
5451

55-
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' ">
56-
<PackageReference Include="System.Collections.Concurrent" Version="4.3.0" />
57-
<PackageReference Include="System.Console" Version="4.3.0" />
58-
<PackageReference Include="System.Diagnostics.Debug" Version="4.3.0" />
59-
<PackageReference Include="System.Diagnostics.Tracing" Version="4.3.0" />
60-
<PackageReference Include="System.IO" Version="4.3.0" />
61-
<PackageReference Include="System.Linq" Version="4.3.0" />
62-
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
63-
<PackageReference Include="System.Net.Security" Version="4.3.2" />
64-
<PackageReference Include="System.Net.Sockets" Version="4.3.0" />
65-
<PackageReference Include="System.Reflection.Extensions" Version="4.3.0" />
66-
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" />
67-
<PackageReference Include="System.Runtime" Version="4.3.0" />
68-
<PackageReference Include="System.Runtime.Extensions" Version="4.3.0" />
69-
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.0" />
70-
<PackageReference Include="System.Threading" Version="4.3.0" />
71-
<PackageReference Include="System.Threading.Thread" Version="4.3.0" />
72-
<PackageReference Include="System.Threading.Timer" Version="4.3.0" />
73-
</ItemGroup>
74-
75-
<ItemGroup>
52+
<ItemGroup Condition="$('TargetFramework') == 'net462'">
7653
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
7754
</ItemGroup>
7855

projects/client/RabbitMQ.Client/src/client/api/ConnectionFactory.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,8 @@
4747
using System.Linq;
4848
using System.Security.Authentication;
4949

50-
#if !NETFX_CORE
51-
5250
using System.Net.Security;
5351

54-
#endif
55-
5652
namespace RabbitMQ.Client
5753
{
5854
/// <summary>Main entry point to the RabbitMQ .NET AMQP client
@@ -551,9 +547,7 @@ private void SetUri(Uri uri)
551547
{
552548
Ssl.Enabled = true;
553549
Ssl.Version = AmqpUriSslProtocols;
554-
#if !(NETFX_CORE)
555550
Ssl.AcceptablePolicyErrors = SslPolicyErrors.RemoteCertificateNameMismatch;
556-
#endif
557551
Port = AmqpTcpEndpoint.DefaultAmqpSslPort;
558552
}
559553
else

projects/client/RabbitMQ.Client/src/client/api/ConnectionFactoryBase.cs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,7 @@
3939
//---------------------------------------------------------------------------
4040

4141
using System;
42-
43-
#if NETFX_CORE
44-
using Windows.Networking.Sockets;
45-
#else
4642
using System.Net.Sockets;
47-
#endif
4843

4944
namespace RabbitMQ.Client
5045
{
@@ -53,24 +48,8 @@ public class ConnectionFactoryBase
5348
/// <summary>
5449
/// Set custom socket options by providing a SocketFactory.
5550
/// </summary>
56-
#if NETFX_CORE
57-
public Func<StreamSocket> SocketFactory = DefaultSocketFactory;
58-
#else
5951
public Func<AddressFamily, ITcpClient> SocketFactory = DefaultSocketFactory;
60-
#endif
6152

62-
#if NETFX_CORE
63-
/// <summary>
64-
/// Creates a new instance of the <see cref="StreamSocket"/>.
65-
/// </summary>
66-
/// <returns>New instance of a <see cref="StreamSocket"/>.</returns>
67-
public static StreamSocket DefaultSocketFactory()
68-
{
69-
StreamSocket tcpClient = new StreamSocket();
70-
tcpClient.Control.NoDelay = true;
71-
return tcpClient;
72-
}
73-
#else
7453
/// <summary>
7554
/// Creates a new instance of the <see cref="TcpClient"/>.
7655
/// </summary>
@@ -84,6 +63,5 @@ public static ITcpClient DefaultSocketFactory(AddressFamily addressFamily)
8463
};
8564
return new TcpClientAdapter(socket);
8665
}
87-
#endif
8866
}
8967
}

projects/client/RabbitMQ.Client/src/client/api/IProtocol.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@
4040

4141
using System;
4242

43-
#if !NETFX_CORE
44-
using System.Net.Sockets;
45-
#else
46-
using Windows.Networking.Sockets;
47-
#endif
48-
4943
using RabbitMQ.Client.Impl;
5044

5145
namespace RabbitMQ.Client

projects/client/RabbitMQ.Client/src/client/api/ITcpClient.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
#if !NETFX_CORE
2-
using System;
1+
using System;
32
using System.Threading.Tasks;
4-
53
using System.Net.Sockets;
6-
using System.Threading;
74

85
namespace RabbitMQ.Client
96
{
@@ -26,4 +23,3 @@ public interface ITcpClient : IDisposable
2623
void Close();
2724
}
2825
}
29-
#endif

projects/client/RabbitMQ.Client/src/client/api/SslHelper.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
// Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
3939
//---------------------------------------------------------------------------
4040

41-
#if !NETFX_CORE
42-
4341
using System;
4442
using System.IO;
4543
using System.Net.Security;
@@ -109,4 +107,3 @@ private bool CertificateValidationCallback(object sender, X509Certificate certif
109107
}
110108
}
111109
}
112-
#endif

projects/client/RabbitMQ.Client/src/client/api/SslOption.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,9 @@
3939
//---------------------------------------------------------------------------
4040

4141

42-
#if !NETFX_CORE
4342
using System.Net.Security;
4443
using System.Security.Authentication;
4544
using System.Security.Cryptography.X509Certificates;
46-
#else
47-
using Windows.Networking.Sockets;
48-
#endif
4945

5046
namespace RabbitMQ.Client
5147
{
@@ -54,28 +50,20 @@ namespace RabbitMQ.Client
5450
/// </summary>
5551
public class SslOption
5652
{
57-
#if !NETFX_CORE
5853
private X509CertificateCollection _certificateCollection;
59-
#endif
6054

6155
/// <summary>
6256
/// Constructs an SslOption specifying both the server cannonical name and the client's certificate path.
6357
/// </summary>
6458
public SslOption(string serverName, string certificatePath = "", bool enabled = false)
6559
{
66-
#if !NETFX_CORE
6760
Version = SslProtocols.Tls;
6861
AcceptablePolicyErrors = SslPolicyErrors.None;
69-
#endif
70-
7162
ServerName = serverName;
7263
CertPath = certificatePath;
7364
Enabled = enabled;
74-
75-
#if !NETFX_CORE
7665
CertificateValidationCallback = null;
7766
CertificateSelectionCallback = null;
78-
#endif
7967
}
8068

8169
/// <summary>
@@ -86,12 +74,10 @@ public SslOption()
8674
{
8775
}
8876

89-
#if !NETFX_CORE
9077
/// <summary>
9178
/// Retrieve or set the set of ssl policy errors that are deemed acceptable.
9279
/// </summary>
9380
public SslPolicyErrors AcceptablePolicyErrors { get; set; }
94-
#endif
9581

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

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

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

164-
#if !NETFX_CORE
165148
/// <summary>
166149
/// Retrieve or set the Ssl protocol version.
167150
/// </summary>
168151
public SslProtocols Version { get; set; }
169-
#endif
170152
}
171153
}

projects/client/RabbitMQ.Client/src/client/exceptions/OperationInterruptedException.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,6 @@ protected OperationInterruptedException(string message, Exception inner)
8686
: base(message, inner)
8787
{
8888
}
89-
/*
90-
#if !(NETFX_CORE)
91-
protected OperationInterruptedException(SerializationInfo info, StreamingContext context)
92-
: base(info, context)
93-
{
94-
}
95-
#endif
96-
*/
9789

9890
///<summary>Retrieves the explanation for the shutdown. May
9991
///return null if no explanation is available.</summary>

projects/client/RabbitMQ.Client/src/client/exceptions/RabbitMQClientException.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,5 @@ protected RabbitMQClientException(string message, Exception innerException) : ba
6767
{
6868

6969
}
70-
71-
/*
72-
#if !(NETFX_CORE)
73-
/// <summary>Initializes a new instance of the <see cref="RabbitMQClientException" /> class with serialized data.</summary>
74-
/// <param name="info">The <see cref="System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown. </param>
75-
/// <param name="context">The <see cref="System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination. </param>
76-
/// <exception cref="System.ArgumentNullException">The <paramref name="info" /> parameter is null. </exception>
77-
/// <exception cref="System.Runtime.Serialization.SerializationException">The class name is null or <see cref="System.Exception.HResult" /> is zero (0). </exception>
78-
[System.Security.SecuritySafeCritical]
79-
protected RabbitMQClientException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context)
80-
{
81-
82-
}
83-
#endif
84-
*/
8570
}
8671
}

projects/client/RabbitMQ.Client/src/client/impl/CommandAssembler.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,6 @@ public Command HandleFrame(InboundFrame f)
128128
}
129129
case AssemblyState.Complete:
130130
default:
131-
#if NETFX_CORE
132-
Debug.WriteLine("Received frame in invalid state {0}; {1}", m_state, f);
133-
#else
134-
//Trace.Fail(string.Format("Received frame in invalid state {0}; {1}", m_state, f));
135-
#endif
136131
return null;
137132
}
138133
}

0 commit comments

Comments
 (0)