Skip to content

Commit 5a3e1b9

Browse files
Richard Greenzidad
authored andcommitted
Additional .NET 4.6 target with regards to EasyNetQ/EasyNetQ#623
1 parent 8b51b71 commit 5a3e1b9

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Source/EasyNetQ/EasyNetQ.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<Description>EasyNetQ</Description>
66
<PackageTags>RabbitMQ;Messaging;AMQP;C#</PackageTags>
77
<PackageIconUrl>https://raw.githubusercontent.com/EasyNetQ/EasyNetQ/gh-pages/design/logo_design.png</PackageIconUrl>
8-
<TargetFrameworks>netstandard2.0;net451</TargetFrameworks>
8+
<TargetFrameworks>netstandard2.0;net451;net46</TargetFrameworks>
99
<DefineConstants>$(DefineConstants);LIBLOG_PUBLIC;LIBLOG_PORTABLE</DefineConstants>
1010
<DefineConstants>$(DefineConstants);LIBLOG_PUBLIC</DefineConstants>
1111
<LangVersion>7.1</LangVersion>
@@ -23,15 +23,15 @@
2323
</ItemGroup>
2424
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
2525
</ItemGroup>
26-
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
26+
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' Or '$(TargetFramework)' == 'net46' ">
2727
<Reference Include="System" />
2828
<Reference Include="System.Configuration" />
2929
<Reference Include="Microsoft.CSharp" />
3030
</ItemGroup>
3131
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
3232
<DefineConstants>$(DefineConstants);NET_STANDARD</DefineConstants>
3333
</PropertyGroup>
34-
<PropertyGroup Condition=" '$(TargetFramework)' == 'net451' ">
34+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net451' Or '$(TargetFramework)' == 'net46' ">
3535
<DefineConstants>$(DefineConstants);NETFX</DefineConstants>
3636
</PropertyGroup>
3737
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.targets))\build.targets" />

Source/EasyNetQ/LightInject/LightInject.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7421,7 +7421,7 @@ public LocalBuilder DeclareLocal(Type type)
74217421
return localBuilder;
74227422
}
74237423
}
7424-
#if NET452
7424+
#if NET452 && !NET46
74257425

74267426
/// <summary>
74277427
/// Provides storage per logical thread of execution.
@@ -7854,4 +7854,4 @@ public class ExcludeFromCodeCoverageAttribute : Attribute
78547854
{
78557855
}
78567856
#endif
7857-
}
7857+
}

Source/EasyNetQ/Producer/ClientCommandDispatcherSingleton.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public Task<T> InvokeAsync<T>(Func<IModel, T> channelAction)
4242
{
4343
Preconditions.CheckNotNull(channelAction, "channelAction");
4444

45-
#if NETFX
45+
#if NETFX && !NET46
4646
var tcs = new TaskCompletionSource<T>();
4747
#else
4848
var tcs = new TaskCompletionSource<T>(TaskCreationOptions.RunContinuationsAsynchronously);
@@ -54,7 +54,7 @@ public Task<T> InvokeAsync<T>(Func<IModel, T> channelAction)
5454
{
5555
if (cancellation.IsCancellationRequested)
5656
{
57-
#if NETFX
57+
#if NETFX && !NET46
5858
tcs.TrySetCanceledAsynchronously();
5959
#else
6060
tcs.TrySetCanceled();
@@ -66,7 +66,7 @@ public Task<T> InvokeAsync<T>(Func<IModel, T> channelAction)
6666
{
6767
persistentChannel.InvokeChannelAction(channel =>
6868
{
69-
#if NETFX
69+
#if NETFX && !NET46
7070
tcs.TrySetResultAsynchronously(channelAction(channel));
7171
#else
7272
tcs.TrySetResult(channelAction(channel));
@@ -75,7 +75,7 @@ public Task<T> InvokeAsync<T>(Func<IModel, T> channelAction)
7575
}
7676
catch (Exception e)
7777
{
78-
#if NETFX
78+
#if NETFX && !NET46
7979
tcs.TrySetExceptionAsynchronously(e);
8080
#else
8181
tcs.TrySetException(e);
@@ -131,4 +131,4 @@ private struct NoContentStruct
131131
{
132132
}
133133
}
134-
}
134+
}

0 commit comments

Comments
 (0)