Getting .NET version at run time?

  • Thread starter Thread starter Michi Henning
  • Start date Start date
M

Michi Henning

Hi,

how can I find out what version of the .NET run time a
binary is running with at *run time*?

In other words, the goal is to produce a binary that,
when run with .NET 1.0, writes "1.0" to the console,
and "1.1" (or whatever other versions we may have in
the future) otherwise.

I tried finding something suitable System.Reflection,
System.Runtime, and System.Type, without luck. Maybe
I keep overlooking the obvious...

Thanks,

Michi.
 
You want the System.Environment.Version property, I think. The major and
minor version numbers should be all you need.
 
Daniel said:
You want the System.Environment.Version property, I think. The major and
minor version numbers should be all you need.

Great, that did the trick. Thanks for your help!

Cheers,

Michi.
 
Back
Top