Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>When you use WiX to create a C# custom action project, it by default creates an XML file called CustomAction.config. The purpose of this file is to instruct sfxca.dll what version of the CLR to use when running your code. The default implementation of this file looks like:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;configuration&gt; &lt;startup useLegacyV2RuntimeActivationPolicy="true"&gt; &lt;!-- Use supportedRuntime tags to explicitly specify the version(s) of the .NET Framework runtime that the custom action should run on. If no versions are specified, the chosen version of the runtime will be the "best" match to what Microsoft.Deployment.WindowsInstaller.dll was built against. WARNING: leaving the version unspecified is dangerous as it introduces a risk of compatibility problems with future versions of the .NET Framework runtime. It is highly recommended that you specify only the version(s) of the .NET Framework runtime that you have tested against. Note for .NET Framework v3.0 and v3.5, the runtime version is still v2.0. In order to enable .NET Framework version 2.0 runtime activation policy, which is to load all assemblies by using the latest supported runtime, @useLegacyV2RuntimeActivationPolicy="true". For more information, see http://msdn.microsoft.com/en-us/library/bbx34a2h.aspx --&gt; &lt;supportedRuntime version="v4.0" /&gt; &lt;supportedRuntime version="v2.0.50727"/&gt; &lt;/startup&gt; &lt;!-- Add additional configuration settings here. For more information on application config files, see http://msdn.microsoft.com/en-us/library/kza1yk3a.aspx --&gt; &lt;/configuration&gt; </code></pre> <p>Basically it's a good practice for CA's written in .NET 2.0/3.0/3.5 ( all CLR 2.0 ) to be allowed to run against 4.0 because you could come across a machine that has only 4.0 installed. Generally your code should work against 4.0 and if it doesn't, I'd fix that.</p> <p>Alternatively you could update the config file to only allow running on 2.0 and then put the needed checks into the installer to make sure that this version of the CLR is infact installed.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload