Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit c5342f0

Browse files
committed
Replace symbold NETSTANDARD2_0 with NETCORE
1 parent 9f48c9e commit c5342f0

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

src/ServiceStack.Redis/BufferedStream.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if NETSTANDARD2_0
1+
#if NETCORE
22
using System;
33
using System.IO;
44
using System.Net.Sockets;

src/ServiceStack.Redis/RedisPubSubServer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ private void KillBgThreadIfExists()
468468
//give it a small chance to die gracefully
469469
if (!bgThread.Join(500))
470470
{
471-
#if !NETSTANDARD2_0
471+
#if !NETCORE
472472
//Ideally we shouldn't get here, but lets try our hardest to clean it up
473473
OnEvent?.Invoke($"[{DateTime.UtcNow.TimeOfDay:g} {GetStatus()}] KillBgThreadIfExists()> bgThread.Interrupt()");
474474
Log.Warn("Interrupting previous Background Thread: " + bgThread.Name);

src/ServiceStack.Redis/ServiceStack.Redis.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@
1212
<PackageTags>Redis;NoSQL;Client;Distributed;Cache;PubSub;Messaging;Transactions</PackageTags>
1313
</PropertyGroup>
1414
<!-- TODO: talk about TFMs; Microsoft.Bcl.AsyncInterfaces starts at net461 -->
15+
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
16+
<DefineConstants>$(DefineConstants);NETCORE</DefineConstants>
17+
</PropertyGroup>
1518
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
16-
<DefineConstants>$(DefineConstants);ASYNC_MEMORY</DefineConstants>
19+
<DefineConstants>$(DefineConstants);ASYNC_MEMORY;NETCORE</DefineConstants>
1720
</PropertyGroup>
1821
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
19-
<DefineConstants>$(DefineConstants);ASYNC_MEMORY;NET6_0</DefineConstants>
22+
<DefineConstants>$(DefineConstants);ASYNC_MEMORY;NETCORE;NET6_0</DefineConstants>
2023
</PropertyGroup>
2124
<ItemGroup Condition="'$(TargetFramework)'=='net45'">
2225
<Compile Remove="**/*.Async.cs" />

src/ServiceStack.Redis/Support/ObjectSerializer.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System.IO;
2-
#if !NETSTANDARD2_0
2+
#if !NETCORE
33
using System.Runtime.Serialization.Formatters.Binary;
44
#endif
55

@@ -11,7 +11,7 @@ namespace ServiceStack.Redis.Support
1111
/// </summary>
1212
public class ObjectSerializer : ISerializer
1313
{
14-
#if !NETSTANDARD2_0
14+
#if !NETCORE
1515
protected readonly BinaryFormatter bf = new BinaryFormatter();
1616
#endif
1717

@@ -23,7 +23,7 @@ public class ObjectSerializer : ISerializer
2323
/// <returns></returns>
2424
public virtual byte[] Serialize(object value)
2525
{
26-
#if NETSTANDARD2_0
26+
#if NETCORE
2727
return null;
2828
#else
2929
if (value == null)
@@ -42,7 +42,7 @@ public virtual byte[] Serialize(object value)
4242
/// <returns></returns>
4343
public virtual object Deserialize(byte[] someBytes)
4444
{
45-
#if NETSTANDARD2_0
45+
#if NETCORE
4646
return null;
4747
#else
4848
if (someBytes == null)

src/ServiceStack.Redis/Support/OptimizedObjectSerializer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ SerializedObjectWrapper SerializeToWrapper(object value)
122122
break;
123123

124124
default:
125-
#if NETSTANDARD2_0
125+
#if NETCORE
126126
data = new byte[0];
127127
length = 0;
128128
#else
@@ -231,7 +231,7 @@ object Unwrap(SerializedObjectWrapper item)
231231
case TypeCode.Object:
232232
using (var ms = new MemoryStream(data, offset, count))
233233
{
234-
#if NETSTANDARD2_0
234+
#if NETCORE
235235
return null;
236236
#else
237237
return bf.Deserialize(ms);

0 commit comments

Comments
 (0)