markmnl
markmnl

Reputation: 11326

Detect which version of .Net is installed? (.Net 3.5 not running on .Net 4)

Despite Mircrosoft's assurances later .Net will always be backward compatible ( http://msdn.microsoft.com/en-us/library/bb822049.aspx ) my .Net 3.5 SP1 app does not run a box with .Net4.....

The user is presented with an error that sheds no light on why the app will not run:

"Unable to find a version of the runtime to run this application."

Great.

So I would like write another app altogether that will run and check if they can run the app, proabably in C++. How can I check what version of .Net is installed and if for sure my app .Net app will run otherwise point the user in the right direction to install the required .Net?

Upvotes: 1

Views: 435

Answers (2)

Matt
Matt

Reputation: 14551

Your .Net 3.5 app should still be able to run, but you'll have to add an entry to your application config file to opt your application into running on .NET Framework 4:

<configuration>
<startup>
    <supportedRuntime version = "v4.0"/>
</startup>
</configuration> 

Upvotes: 1

SLaks
SLaks

Reputation: 888107

Check the registry.

Upvotes: 3

Related Questions