Search code examples
.netvb.netwindows-8.net-4.0compatibility

Using .net 2.0/3.0/3.5 on windows 8 fresh install


I'm working on a testing solution for newly refurbish laptops, and am unable to install .net framework on the machines that the solution needs to run on. I have made sure that the program complies with .net 2.0, and it runs fine on older machines. Windows 8 comes with .net 4.0, so I thought it should be able to handle the program, but I'm prompted to download .net 3.5 on every machine.
My question is this, is there a way to circumvent the need to install the additional .net version(s) to each computer to run this program, or will I have to create a new program and use this one as "legacy"?

Thanks in advance!


Solution

  • Try forcing the app to run using .Net 4.0 by editing the Runtime Element in the App.Config (or exe.config):

    <configuration>
      <startup>
        <supportedRuntime version="<version>"/>
      </startup>
    </configuration>
    

    MSDN Refs:

    <runtime> Element

    How to: Configure an App to Support .NET Framework 4 or 4.5