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

Commit f57a003

Browse files
committed
Target net45+win
1 parent f6520a5 commit f57a003

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

src/Microsoft.Framework.Caching.Interfaces/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"System.Runtime": "4.0.20-beta-*"
1010
}
1111
},
12-
"netcore451": {
12+
".NETPortable,Version=v4.5,Profile=Profile7": {
1313
"frameworkAssemblies": {
1414
"System.Runtime": ""
1515
}

src/Microsoft.Framework.Caching.Memory/CacheEntry.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System;
55
using System.Collections.Generic;
66
using System.Threading;
7-
#if NETCORE451
7+
#if !NET45 && !DNX451 && !DNXCORE50
88
using System.Threading.Tasks;
99
#endif
1010

@@ -17,7 +17,7 @@ internal class CacheEntry
1717
private static readonly Action<object> ExpirationCallback = TriggerExpired;
1818

1919
private readonly Action<CacheEntry> _notifyCacheOfExpiration;
20-
20+
2121
internal CacheEntry(CacheSetContext context, object value, Action<CacheEntry> notifyCacheOfExpiration)
2222
{
2323
Context = context;
@@ -141,10 +141,10 @@ internal void InvokeEvictionCallbacks()
141141
Context.PostEvictionCallbacks = null;
142142
if (callbacks != null)
143143
{
144-
#if NETCORE451
145-
Task.Run(() => InvokeCallbacks(callbacks));
146-
#else
144+
#if NET45 || DNX451 || DNXCORE50
147145
ThreadPool.QueueUserWorkItem(InvokeCallbacks, callbacks);
146+
#else
147+
Task.Run(() => InvokeCallbacks(callbacks));
148148
#endif
149149
}
150150
}

src/Microsoft.Framework.Caching.Memory/EntryLinkHelpers.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System;
55
#if DNXCORE50
66
using System.Threading;
7-
#elif !NETCORE451
7+
#elif NET45 || DNX451 || DNXCORE50
88
using System.Runtime.Remoting;
99
using System.Runtime.Remoting.Messaging;
1010
#endif
@@ -21,13 +21,7 @@ public static IEntryLink ContextLink
2121
get { return _contextLink.Value; }
2222
set { _contextLink.Value = value; }
2323
}
24-
#elif NETCORE451
25-
public static IEntryLink ContextLink
26-
{
27-
get { return null; }
28-
set { throw new NotImplementedException(); }
29-
}
30-
#else
24+
#elif NET45 || DNX451
3125
private const string ContextLinkDataName = "klr.host.EntryLinkHelpers.ContextLink";
3226

3327
public static IEntryLink ContextLink
@@ -48,6 +42,12 @@ public static IEntryLink ContextLink
4842
CallContext.LogicalSetData(ContextLinkDataName, new ObjectHandle(value));
4943
}
5044
}
45+
#else
46+
public static IEntryLink ContextLink
47+
{
48+
get { return null; }
49+
set { throw new NotImplementedException(); }
50+
}
5151
#endif
5252
public static IDisposable FlowContext(this IEntryLink link)
5353
{

src/Microsoft.Framework.Caching.Memory/MemoryCache.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using Microsoft.Framework.Caching.Memory.Infrastructure;
99
using Microsoft.Framework.Internal;
1010
using Microsoft.Framework.OptionsModel;
11-
#if NETCORE451
11+
#if !NET45 && !DNX451 && !DNXCORE50
1212
using System.Threading.Tasks;
1313
#endif
1414

@@ -263,10 +263,10 @@ private void StartScanForExpiredItems()
263263
if (_expirationScanFrequency < now - _lastExpirationScan)
264264
{
265265
_lastExpirationScan = now;
266-
#if NETCORE451
267-
Task.Run(() => ScanForExpiredItems(state: null));
268-
#else
266+
#if NET45 || DNX451 || DNXCORE50
269267
ThreadPool.QueueUserWorkItem(ScanForExpiredItems);
268+
#else
269+
Task.Run(() => ScanForExpiredItems(state: null));
270270
#endif
271271
}
272272
}

src/Microsoft.Framework.Caching.Memory/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"System.Threading.ThreadPool": "4.0.10-beta-*"
1616
}
1717
},
18-
"netcore451": {
18+
".NETPortable,Version=v4.5,Profile=Profile7": {
1919
"frameworkAssemblies": {
2020
"System.Threading.Tasks": ""
2121
}

0 commit comments

Comments
 (0)