title: How do I set the .NET Framework version used to run a MSIExec Custom Action
body: <p>I am using WiX to create a MSI that calls a managed Custom Action (CA) written with Votive in VS 2008.  The CA targets .NET 32 bit Framework 3.5.  When I run the setup it fails loading the CA since it cannot find the right framework version.  In the MSI installation log are the lines</p>
  <blockquote>
  <p>MSI (s) (5C:C0) [10:25:00:680]: Hello, I'm your 32bit Impersonated custom action server.<br />
  SFXCA: Extracting custom action to temporary directory: C:\Windows\Installer\MSI34ED.tmp-\<br />
  SFXCA: Binding to CLR version v4.0.30319</p>
  </blockquote>
  <p>I have worked out that the issue is the wrong framework version is being loaded.  It seems to be the inverse problem mentioned when trying to run a <a href="https://stackoverflow.com/questions/3468964/wix-c-custom-action-net-4-error">version 4 CA and version 2 of the framework</a> is loaded by MSIExec (I assume it is the MSIExec that decides to load the framework).</p>
  <p>I have VS 2010 installed on the box as well, but for reasons beyond my control I must use VS 2008 for the project. If I upgrade the project to VS 2010 everything runs as expected, since the CA is then targeted to .NET 4.0.</p>
  <p>Is there some way I can get MSIExec to load .NET 2.0/3.5 when calling the Custom Action?</p>
  <p>UPDATE: I have changed the CustomAction.config so that it now has<br />
  <code>&lt;!--&lt;supportedRuntime version=&quot;v4.0&quot; /&gt;--&gt;</code><br />
  <code>&lt;supportedRuntime version=&quot;v2.0.50727&quot;/&gt;</code><br />
  and it has made no difference.</p>
  <p>I have also found that it is the act of trying to load the CA into the debugger that is causing the exception.  If I run the msi without breaking on the method, it runs as expected (no errors).  SO I can deploy the setup as a .NET 3.5 setup, I just cannot debug the CA.</p>