title: The type or namespace name 'ConsoleTraceListener' could not be found (are you missing a using directive or an assembly reference?)
body: <p>I try to write the C# program with 2 files: SyncService.cs and Program.cs as followed:</p>
  <p><strong>Program.cs</strong></p>
  <pre><code>using System;
  using System.Diagnostics;
  
  namespace AzcopySync
  {
      public class Program
      {
          public static void Main(string[] args)
          {
              Trace.Listeners.Add(new ConsoleTraceListener());
              Trace.WriteLine(&quot;Program Started - &quot; + DateTime.Now.ToString());Trace.WriteLine(&quot;&quot;);
  
              //Call into a separate class or method for the actual program logic
              //DoSomething(); //I'll use Trace for output in here rather than Console
              string source = &quot;/home/potivora/data&quot;;
              string dest = &quot;https://dfqualifstoracc.blob.core.windows.net/media-shutima&quot;;
              SyncService mySyncService = new SyncService();
              //mySyncService.TriggerBlobSync(source, dest);
  
              Console.WriteLine(mySyncService.TriggerBlobSync(source, dest));
           
              Trace.WriteLine(&quot;&quot;);Trace.WriteLine(&quot;Program Finished - &quot; + DateTime.Now.ToString());
  
              Console.Write(&quot;Press a key to exit...&quot;);
              Console.ReadKey(true);
              Console.WriteLine();
          }
      }
  }
  </code></pre>
  <p><strong>SyncService.cs</strong></p>
  <pre><code>using System;
  using System.Diagnostics;
  
  namespace AzcopySync
  {
     public class SyncService 
     {
        const string AZCOPY_SYNC_CMD = &quot; sync \&quot;{0}\&quot; \&quot;{1}{2}\&quot; --recursive&quot;;
        const string SASToken = &quot;?sv=2019-10-10&amp;si=upload-images&amp;sr=c&amp;sig=WZ7b6EbuPNev1cGEmepuy4%2FTNKBgvZ5zqEU246KrSNs%3D&quot;;
     
        public SyncService ()
        {
        }
  
        public string TriggerBlobSync(string sourcePath, string destPath)
        {
           ProcessStartInfo si = new ProcessStartInfo(&quot;azcopy&quot;)
           {
               Arguments = string.Format(AZCOPY_SYNC_CMD, sourcePath, destPath, SASToken),
               CreateNoWindow = true,
               UseShellExecute = false,
               RedirectStandardOutput = true
           };
  
           Console.WriteLine(si.FileName + &quot;&quot; + si.Arguments);
  
           var process = Process.Start(si);
           return process.StandardOutput.ReadToEnd();
        }
     
     }
  }
  </code></pre>
  <p>When I do &quot;dotnet run&quot;, I get this error message.</p>
  <p><a href="https://i.stack.imgur.com/qmU47.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qmU47.png" alt="compileERR" /></a></p>
  <p>Normally my code already compile and run correctly just with SyncService.cs. However, I decided to add Program.cs since I saw many example of C# program on Internet with the file Program.cs in the project as well even though I am not sure if I need to have it or not. So I actually, move the main function from SynService.cs to Program.cs because I think I should have only 1 main as I got another error about this before fixing this issue.
  Could you please help me to point out what can be the root cause?</p>