title: Wix Custom action - debugging
body: <p>I am trying hard to debug a custom action in a wix installation. The action itself starts like this:</p>
  
  <pre><code>    [CustomAction]
      public static ActionResult CheckFiles(Session session)
      {
          Log("starting");
          var db = session.Database;
          try
          {
              var data = new CustomActionData();
              var present = db.OpenView("SELECT 'Id' FROM CivicaDBTable");
  ...
  </code></pre>
  
  <p>The "log" call is an attempt to write a message to a log file (using File.WriteAllText). I have also tried every other method I can find - messageboxing, attaching to the process and putting break points in, trying to force a debug connection - none of which seem to do anything. </p>
  
  <p>However, I do know that the action is running - the log shows this:</p>
  
  <pre><code>MSI (s) (64:68) [11:30:59:511]: Doing action: CheckFiles
  MSI (s) (64:68) [11:30:59:512]: Note: 1: 2205 2:  3: ActionText 
  Action 11:30:59: CheckFiles. 
  Action start 11:30:59: CheckFiles.
  MSI (s) (64:CC) [11:30:59:527]: Invoking remote custom action. DLL:     C:\Windows\Installer\MSI9F06.tmp, Entrypoint: CheckFiles
  MSI (s) (64:3C) [11:30:59:528]: Generating random cookie.
  MSI (s) (64:3C) [11:30:59:529]: Created Custom Action Server with PID 13880 (0x3638).
  MSI (s) (64:E8) [11:30:59:546]: Running as a service.
  MSI (s) (64:E8) [11:30:59:547]: Hello, I'm your 32bit Impersonated custom action server.
  SFXCA: Extracting custom action to temporary directory: C:\Users\STEVE~1.CLO\AppData\Local\Temp\MSI9F06.tmp-\
  SFXCA: Binding to CLR version v4.0.30319
  Calling custom action SQL Processing!SQL_Processing.CustomActions.CheckFiles
  Action ended 11:30:59: CheckFiles. Return value 1.
  </code></pre>
  
  <p>So the evidence is that the action is called, and the install succeeds, but I am not seeming to get any information out of it. I Need to have some form of insight into what it is doing to process any further - Once I am certain that the Action processing is giving me what I need, I can code and test the rest of the processing. But I need this part to work in this environment.</p>