Where'd *that* string come from?

by Michael S. Kaplan, published on 2006/11/19 19:01 -05:00, original URI: http://blogs.msdn.com/b/michkap/archive/2006/11/19/1104659.aspx


Remember when I posted about Was the name ever really onghornlay?

I noticed that Environment.OSVersion.ToString() was returning Microsoft Windows NT 6.0.6000.0 rather than anything about either Longhorn or Vista.

I guess someone forgot to tell the .NET Framework to use the branding functionality? :-)

The BCL really does construct the string based on a GetVersionEx call that combines the type of Windows and the version number, and does nothing related to the name.

No biggee, it just seemed odd to me given all the effort to avoid coming up with the name in any independent way....

On the other hand, there doesn't seem to be any big rush to document how the branding stuff works, so maybe we didn't give them a whole lot of options.

 

This post brought to you by  (U+17bf, a.k.a. KHMER VOWEL SIGN YA)


# Eric Lee on 13 Feb 2007 8:20 PM:

Hey Michael,

I'm seeing some funny behaviour with Environment.OSVersion.ToString() from my .NET application running on Windows Vista and I thought you might have some insight.

I have a simple Windows Form application that calls Environment.OSVersion.ToString() in its Main().  After I build the application, I go over in Windows Explorer and set the compatibility mode to Windows XP SP2.

When I run the application, my version string comes out as 6.0.6000.0 - Vista instead of 5.1 something for XP SP2.

Oddly, if I set the compatibility mode to Windows Server 2003 SP1, then my version string comes out as expected, 5.2 something.

Is there anything that might cause this behavior?  This is a regular Windows Forms application created from the New Project dialog, no funny .config files or anything.

Any insight you might offer would be appreciated.

Thanks,

Eric.


Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

go to newer or older post, or back to index or month or day