File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Filter options
src/Exceptionless/Logging Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Original file line number Diff line number Diff line change @@ -312,27 +312,27 @@ protected string GetLastLinesFromFile(int lines = 100) {
312
312
/// Allows file based locking across processes
313
313
/// </summary>
314
314
private Mutex CreateSystemFileMutex ( string fileNameOrPath ) {
315
+ string name = GetFileBasedMutexName ( fileNameOrPath ) ;
316
+
315
317
#if NET45
316
318
var security = new MutexSecurity ( ) ;
317
319
var allowEveryoneRule = new MutexAccessRule ( new SecurityIdentifier ( WellKnownSidType . WorldSid , null ) , MutexRights . FullControl , AccessControlType . Allow ) ;
318
320
security . AddAccessRule ( allowEveryoneRule ) ;
319
321
320
- string name = GetFileBasedMutexName ( fileNameOrPath ) ;
321
-
322
322
try {
323
323
return new Mutex ( false , name , out bool _ , security ) ;
324
324
} catch ( Exception ex ) {
325
325
if ( ex is SecurityException || ex is UnauthorizedAccessException || ex is NotSupportedException || ex is NotImplementedException ) {
326
326
System . Diagnostics . Trace . WriteLine ( "Exceptionless: Error creating global mutex falling back to previous implementation: {0}" , ex . ToString ( ) ) ;
327
- return new Mutex ( false , nameof ( FileExceptionlessLog ) ) ;
327
+ return new Mutex ( false , name ) ;
328
328
}
329
329
330
330
System . Diagnostics . Trace . WriteLine ( "Exceptionless: Error creating global mutex: {0}" , ex . ToString ( ) ) ;
331
331
throw ;
332
332
}
333
333
#else
334
334
System . Diagnostics . Trace . WriteLine ( "Exceptionless: This platform does not support taking out a global mutex" ) ;
335
- return new Mutex ( false , nameof ( FileExceptionlessLog ) ) ;
335
+ return new Mutex ( false , name ) ;
336
336
#endif
337
337
}
338
338
You can’t perform that action at this time.
0 commit comments