title: Error 2896 using a WiX C#/.NET 4 custom action
body: <p>I am trying to use my first custom action in WiX and I get:</p>
  
  <blockquote>
    <p>error 2896: Executing action CustomActionTest failed.</p>
  </blockquote>
  
  <p>I am using Visual Studio 2010, WiX 3.5, 64-bit Windows 7 Ultimate, .NET Framework 4.</p>
  
  <p>Here are what I think are the relevant sections:</p>
  
  <pre><code>&lt;Binary Id="JudgeEditionCA" SourceFile="..\JudgeEditionCA\bin\Debug\JudgeEdition.CA.dll" /&gt;
  &lt;CustomAction Id="CustomActionTest" BinaryKey="JudgeEditionCA" DllEntry="CustomActionOne" Execute="immediate"/&gt;
  
  &lt;Control Id="Next" Type="PushButton" X="248" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" &gt;
      &lt;Publish Event="DoAction" Value="CustomActionTest"&gt;1&lt;/Publish&gt;
      &lt;Publish Event="DoAction" Value="InvalidClientDesc"&gt;CLIENT_DESC_VALID = "0"&lt;/Publish&gt;
      &lt;Publish Event="NewDialog" Value="VerifyReadyDlg"&gt;CLIENT_DESC_VALID = "1"&lt;/Publish&gt;
  &lt;/Control&gt;
  </code></pre>
  
  <p>From the action:</p>
  
  <pre><code>namespace JudgeEditionCA
  {
      public class CustomActions
      {
          [CustomAction]
          public static ActionResult CustomActionOne( Session session )
          {
              return ActionResult.Success;
          }
      }
  }
  </code></pre>
  
  <p>And the configuration file from the custom action:</p>
  
  <pre><code>&lt;configuration&gt;
      &lt;startup useLegacyV2RuntimeActivationPolicy="false"&gt;
          &lt;supportedRuntime version="v4.0" /&gt;
      &lt;/startup&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>And finally I have used a project reference in my WiX project to the custom action. I am not sure what I am doing wrong.</p>