File tree 4 files changed +40
-8
lines changed
Solid/PostSharp.Samples.Caching
4 files changed +40
-8
lines changed Original file line number Diff line number Diff line change 66
66
</ItemGroup >
67
67
<ItemGroup >
68
68
<PackageReference Include =" PostSharp" >
69
- <Version >6.4.4 </Version >
69
+ <Version >6.4.6 </Version >
70
70
</PackageReference >
71
71
<PackageReference Include =" PostSharp.Patterns.Caching" >
72
- <Version >6.4.4 </Version >
72
+ <Version >6.4.6 </Version >
73
73
</PackageReference >
74
74
<PackageReference Include =" PostSharp.Patterns.Caching.Redis" >
75
- <Version >6.4.4</Version >
75
+ <Version >6.4.6</Version >
76
+ </PackageReference >
77
+ <PackageReference Include =" PostSharp.Patterns.Diagnostics" >
78
+ <Version >6.4.6</Version >
76
79
</PackageReference >
77
80
<PackageReference Include =" redis-64" >
78
81
<Version >3.0.503</Version >
79
82
</PackageReference >
83
+ <PackageReference Include =" StackExchange.Redis" >
84
+ <Version >2.0.601</Version >
85
+ </PackageReference >
86
+ <PackageReference Include =" System.Buffers" >
87
+ <Version >4.5.0</Version >
88
+ </PackageReference >
80
89
<PackageReference Include =" System.Collections.Immutable" >
81
90
<Version >1.7.0</Version >
82
91
</PackageReference >
92
+ <PackageReference Include =" System.Runtime.CompilerServices.Unsafe" >
93
+ <Version >4.7.0</Version >
94
+ </PackageReference >
83
95
<PackageReference Include =" System.ValueTuple" >
84
96
<Version >4.5.0</Version >
85
97
</PackageReference >
Original file line number Diff line number Diff line change 1
1
using PostSharp . Patterns . Caching ;
2
2
using PostSharp . Patterns . Caching . Backends . Redis ;
3
+ using PostSharp . Patterns . Diagnostics ;
4
+ using PostSharp . Patterns . Diagnostics . Backends . Console ;
3
5
using StackExchange . Redis ;
4
6
using System ;
5
7
using System . Linq ;
@@ -10,12 +12,20 @@ namespace PostSharp.Samples.Caching
10
12
internal class Program
11
13
{
12
14
private static void Main ( string [ ] args )
13
- {
15
+ {
16
+
17
+ AppDomain . CurrentDomain . FirstChanceException += CurrentDomain_FirstChanceException ;
18
+ LoggingServices . DefaultBackend = new ConsoleLoggingBackend ( ) ;
19
+
20
+ // Uncomment the next line for detailed logging.
21
+ // LoggingServices.DefaultBackend.DefaultVerbosity.SetMinimalLevel(LogLevel.Debug, LoggingRoles.Caching);
22
+
14
23
using ( RedisServer . Start ( ) )
15
24
{
16
25
using ( var connection = ConnectionMultiplexer . Connect ( "localhost:6380,abortConnect = False" ) )
17
26
{
18
-
27
+
28
+ connection . InternalError += ( sender , eventArgs ) => Console . Error . WriteLine ( eventArgs . Exception ) ;
19
29
connection . ErrorMessage += ( sender , eventArgs ) => Console . Error . WriteLine ( eventArgs . Message ) ;
20
30
connection . ConnectionFailed += ( sender , eventArgs ) => Console . Error . WriteLine ( eventArgs . Exception ) ;
21
31
@@ -62,6 +72,11 @@ private static void Main(string[] args)
62
72
}
63
73
}
64
74
}
65
- }
75
+ }
76
+
77
+ private static void CurrentDomain_FirstChanceException ( object sender , System . Runtime . ExceptionServices . FirstChanceExceptionEventArgs e )
78
+ {
79
+
80
+ }
66
81
}
67
82
}
Original file line number Diff line number Diff line change @@ -27,7 +27,11 @@ public void Dispose()
27
27
28
28
public static RedisServer Start ( )
29
29
{
30
- if ( ! Process . GetProcessesByName ( "redis-server" ) . Any ( ) )
30
+ if ( Process . GetProcessesByName ( "redis-server" ) . Any ( ) )
31
+ {
32
+ Console . WriteLine ( "Redis has already started." ) ;
33
+ }
34
+ else
31
35
{
32
36
var configFile = Path . GetFullPath ( "redis.conf" ) ;
33
37
Original file line number Diff line number Diff line change 1
1
port 6380
2
2
bind 127.0.0.1
3
3
maxmemory-policy volatile-lru
4
- notify-keyspace-events AKE
4
+ notify-keyspace-events AKE
5
+ loglevel verbose
You can’t perform that action at this time.
0 commit comments