Fix remaining warnings
MODIFY
src/Chapter10/Listing10.23.RegisteringAFinalizerWithProcessExit.cs
src/Chapter10/Listing10.23.RegisteringAFinalizerWithProcessExit.cs
public void Dispose()
{
Dispose(true);
+ // Unregister from the finalization queue.
+ GC.SuppressFinalize(this);
}
#endregion
#pragma warning restore CA1816
if (disposing)
{
WriteLine("Disposing managed stuff...");
-
- // Unregister from the finalization queue.
- GC.SuppressFinalize(this);
}
AppDomain.CurrentDomain.ProcessExit -=

MODIFY
src/Chapter19/Listing19.07.RegisteringForUnhandledExceptions.cs
src/Chapter19/Listing19.07.RegisteringForUnhandledExceptions.cs
public class Program
{
- public static Stopwatch _Clock = new Stopwatch();
+ private static Stopwatch Clock { get; } = new Stopwatch();
+
public static void Main()
{
try
{
- _Clock.Start();
+ Clock.Start();
// Register a callback to receive notifications
// of any unhandled exception
#if NETCOREAPP1_1
{
Console.WriteLine("{0}:{1:0000}:{2}",
Thread.CurrentThread.ManagedThreadId,
- _Clock.ElapsedMilliseconds, text);
+ Clock.ElapsedMilliseconds, text);
}
}
}

Fix remaining warnings