> > >I write a VBS script witch uses csc.exe (command line dotnet compiler),
> > >but my problem is to detect what version of Dotnet Framework is
[quoted text clipped - 16 lines]
>
> Bruno
On the other hand, how would you know if the code you're trying to
compile uses deprecated/unsupported features, or features for which
breaking changes have been made, in a later version of the framework.
Your situation is: you *know* (or have good reason to suspect) that
your code compiles with C# 2.0. You *know* (or have good...) that your
code compiles with C# 1.1. Your code may work with C#3.0 beta. Does
your code compile with version 4, with version 5, etc?
I've taken a quick scan through the registry, but there doesn't seem to
be anything obvious. You could try enumerating keys under
HKLM\Software\Microsoft\NET Framework Setup\NDP and getting the latest
version, then looking under the directory you can find through the
InstallRoot value under the HKLM\Software\Microsoft\.NET Framework key.
(Or directly search the directories under that directory for
directories which match the patter vn.n.nnnn)
In either case, you'll be dealing with strings and you'll have to do
careful parsing (if you're really future-proofing) that, for instance,
v10.0 sorts higher then v2.
Good luck!
Damien
bcastaing@gmail.com - 29 Jun 2006 16:51 GMT
Hi,
The Microsoft.NET registry key seems to be different between version
1.1 or 2.0, so do you the better solution to get the actual version
installed ?
Is it listing %WINDIR%\Microosft.NET\Framework\*. and sort the result
and get the highest value ?
Or WMI fonction ?
Do you know a script to do any working solution ?
Thanks
Bruno
Damien a écrit :
> > > >I write a VBS script witch uses csc.exe (command line dotnet compiler),
> > > >but my problem is to detect what version of Dotnet Framework is
[quoted text clipped - 41 lines]
>
> Damien