title: Custom Action in C# used via WiX fails with error 1154
body: <p>I am using WiX 3.5.1930 in Visual Studio 2010, targeting the .NET Framework 3.5.  (Later weekly builds of WiX seem to be very broken with respect to their custom action template, at least for now.  1930 is the most recent build that seems to make a buildable C# CA with working references.)</p>
  
  <p>I have two custom action assemblies written in C#.  One of them works fine.  The other fails with the following error:</p>
  
  <pre><code>CustomActionnNameHere returned actual error code 1154 (note this may not be 100% accurate if translation happened inside sandbox)
  </code></pre>
  
  <p>I have compared the .csproj files and .wixproj files, and as best I can tell the differences are appropriate (e. g. list of included .cs files).  I have changed the non-working .wxs to call the working custom action instead of the non-working custom action and it works as epxected.</p>
  
  <p>What else can I look at to get this working?</p>
  
  <p>Edit: Just to be complete 1154 refers to an invalid DLL - net helpmsg translates it (in English) to "One of the library files needed to run this application is damaged."</p>
  
  <p>Second edit: ran peverify against the dll (grabbed a copy out of \windows\installer while the installer was running) and it says everything is fine in the dll.  The DLL only has the custom action method with a "return success" so there's not a lot for it to verify, but it does confirm the DLL is not corrupt.</p>
  
  <p>Third edit: The code in the broken custom action follows:</p>
  
  <pre><code>using Microsoft.Deployment.WindowsInstaller;
  
  namespace Framework.Installer.Database {
      public class CustomActions {
  
          [CustomAction]
          public static ActionResult RunMigration(Session session) {
  
              return ActionResult.Success;
          }
  
      }
  }
  </code></pre>
  
  <p>Not much to it.  The relevant parts of the .wxs are as follows:</p>
  
  <pre><code>&lt;InstallExecuteSequence&gt;
    &lt;Custom Action="DotNetMigratorCustomActionPreviousUp" After="SetMigrationPropertiesPreviousUp"&gt;&lt;![CDATA[(&amp;Database = 3)]]&gt;&lt;/Custom&gt;
  &lt;/InstallExecuteSequence&gt;
  
  &lt;Binary Id="DotNetMigratorCustomActionDll"
          SourceFile="$(var.Framework.Installer.Database.CustomActions.TargetDir)\SoftwareAnswers.Framework.Installer.Database.CustomActions.dll" /&gt;
  
  &lt;CustomAction Id="DotNetMigratorCustomActionPreviousUp"
                Return="check"
                BinaryKey="DotNetMigratorCustomActionDll"
                DllEntry="RunMigration"
                Execute="deferred" /&gt;
  </code></pre>