C# Core 3.4: Added try-catch  for Trace statement