check .net version installed

I'm working in VS 2005 .NET 2.0, how can I check if this net's version is installed at run time.

I know that if not is intalled exe application throw an error, send to microsoft, etc.
but I would like to shows a friendly message to "you need to update to .NET 2" or something like that and exit the app.

thanks in advance for your help,
Edward


Answer this question

check .net version installed

  • Nokoff

    Hi Edward,

    You can use "System.Version" class to check version of CLR (i.e, .net version ) installed on machine.

    Regards

    Chitrsen Aujikar


  • Ofer Elboher

    You need to create non .NET application for that. Setup.exe from setup build when having prerequisities is just like that. If you don't want the message from MS that gives information about not having .NET 2.0 and a link for immediate download which i think is just fine, then you should think of creating another application. You can do that in native C++ that will not require .NET.

  • Smealum

    you can use Environment.Version to get the version of the .NET Framework. As bob said, to really check before installing you need to create a non .NET app.

  • check .net version installed