title: WinDbg extension not recognizing command
body: <p>I am trying to write a WinDbg extension command and running into some problems. I started with <a href="https://github.com/kevingosse/windbg-extensions/blob/master/src/LoadSos/ToggleSosViewModel.cs" rel="nofollow noreferrer">this</a> project and tried to modify it to supply a custom command in the debugger.</p>
  
  <p>However when I run <code>TestCommand</code> I get the following error. </p>
  
  <p><code>The command was: !TestCommand this is a test0:000&gt; !TestCommand this is a test
  No export TestCommand found</code></p>
  
  <p>The full code I have is below. I have attempted adding the <code>[Export]</code> modifier to the TestCommand function however this has not rectified the situation. How would I get WinDbg to recognize the command?</p>
  
  <p>Full extension code:</p>
  
  <pre><code>using System.ComponentModel.Composition;
  using DbgX.Interfaces;
  using DbgX.Interfaces.Enums;
  using DbgX.Interfaces.Listeners;
  using DbgX.Interfaces.Services;
  using DbgX.Util;
  
  namespace WinDbgExt.LoadSos
  {
      [Export(typeof(IDbgCommandExecutionListener))]
      [Export(typeof(IDbgStartupListener))]
  
      public class ToggleSosViewModel : IDbgCommandExecutionListener, IDbgStartupListener
      {
          private bool _engineLoaded;
  
          [Import]
          private IDbgConsole _console;
  
          [Import]
          private IDbgEngineState _engineState;
  
          public void OnCommandExecuted(string command)
          {
              if (command.StartsWith("!TestCommand"))
              {
                  TstCommand(command);
  
              }
          }
  
          public void TestCommand(string command)
          {
              _console.PrintTextToConsole("The command was: " + command);
          }
  
          public void OnStartup()
          {
  
          }
      }
  }
  </code></pre>
  
  <p>As a bonus question I need to get a handle for the process that WinDbg is attached to. Is there a simple way to add that to the above extension?</p>