KMC
KMC

Reputation: 20046

How to check version of .NET install on the computer

I am writing a WPF C# Desktop app, and I want to check if the client computer has .NET installed before running the application.

How to check what version of .NET has been installed on the client computer? Or, is it possible?

Upvotes: 4

Views: 2668

Answers (5)

NathanAW
NathanAW

Reputation: 3367

ClickOnce has some features to help with this.

When you publish your application, it'll allow you to specify what dependencies you have, including the .NET framework. If the dependencies are missing, the ClickOnce setup will install them before running the application.

Upvotes: 0

VoimiX
VoimiX

Reputation: 1190

You can check it in the setup installer. A WPF application can't run on a computer without .NET.

Upvotes: 0

Hinek
Hinek

Reputation: 9719

Checking if the right .NET version is installed is not the job of your application, because if it isn't installed, your application won't start in the first place.

You should create an installer that does the checking. The setup project you can create in Visual Studio does this by default.

Upvotes: 5

Cortright
Cortright

Reputation: 1174

Your .NET app won't run without the right Framework installed and they'll get an error. You can include .NET Framework redistributable as part of your installation to ensure user has Framework installed when they run your app.

Upvotes: 0

Justin
Justin

Reputation: 86729

There seem to be a couple of methods:

Upvotes: 2

Related Questions