Set WindowApp from Net3.5 to 4.0
Can I set the app.config 'useLegacyV2RuntimeActivationPolicy' attribute programmatically?

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>
8/12/2021 10:47:41 AM