.NET Framework version - determine on thecommand line

  • Thread starter Thread starter Joubert
  • Start date Start date
J

Joubert

Hi,

Does anybody know how to do this? (excluding looking at the folder structure under %windir%)

Cheers
Joubert
 
Joubert said:
Does anybody know how to do this? (excluding looking at the
folder structure under %windir%)

Compile and run this console app:

using System;

public class Test
{
static void Main()
{
Console.WriteLine (Environment.Version);
}
}
 
Perhaps I should have been more explicit.

I would like to use something which is guaranteed to be on the user's
computer (e.g. "c:\ver <return>").

If there is no known command line exe that is installed with the Framework,
can I see it elsewhere in the shell? E.g. My Computer\Properties or in
Explorer Help\About ??

Cheers
Joubert
 
BenoitM said:
perhaps it won't help, but if you do 'AL /?' it display the version of the
framework for which it's built ...

Similarly just running csc with no arguments will give:

Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

fatal error CS2008: No inputs specified

Of course, csc isn't on the path by default...
 
plus it doesn't come with the .NET Framework distributable (correct me if
I'm wrong), so it is still not a satisfactory solution.. :-(
 
not verified, but i think that csc & al are installed with the redist,
because they are needed for asp.net dynamic compilation ...
anyway i looked at the dotnetfx.exe and i'm sure that ngen.exe is installed
on the target machine, so you can use 'ngen /?' ...

Joubert said:
plus it doesn't come with the .NET Framework distributable (correct me if
I'm wrong), so it is still not a satisfactory solution.. :-(
 
Great. That helps. It is just a pity ngen is not in the path. But at least
it is a solution.

Cheers



BenoitM said:
not verified, but i think that csc & al are installed with the redist,
because they are needed for asp.net dynamic compilation ...
anyway i looked at the dotnetfx.exe and i'm sure that ngen.exe is installed
on the target machine, so you can use 'ngen /?' ...
 
Joubert said:
plus it doesn't come with the .NET Framework distributable (correct me if
I'm wrong), so it is still not a satisfactory solution.. :-(

They definitely are in the redistributable - the SDK doesn't install on
Windows 98, so the redistributable is all I've got on my W98 box :)
 
Back
Top