Can I set the app.config 'useLegacyV2RuntimeActivationPolicy' attribute progamatically?

Posted by Thiado de Arruda on Stack Overflow See other posts from Stack Overflow or by Thiado de Arruda
Published on 2010-05-27T19:28:01Z Indexed on 2010/05/27 19:31 UTC
Read the original article Hit count: 1365

Filed under:
|
|
|
|

I had to migrate a .NET 3.5 to 4.0 but some dll's were not loading, after googling I found that creating an app.config would solve it:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" />
  </startup>
</configuration>

I would like to setup these options without using configuration files, is it possible?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET