Home All Groups Group Topic Archive Search About

Problem using System.Environment.SystemDirectory

Author
29 Apr 2009 3:24 PM
moondaddy
Using vb.net 2.0 and trying to get the drive letter the OS is installed on,
so from a console app I'm trying this:

Dim systemDirectory As String = Environment.SystemDirectory

However, systemDirectory  is coming up null.  when I put a watch on
Environment.SystemDirectory, it says "Property evaluation failed."

But it works when I do this:

Console.WriteLine("SystemDirectory: {0}", Environment.SystemDirectory)

it works which I dont understand.  Any idea how I can get the first line
above to work?

Thanks.



--
moondaddy@newsgroup.nospam

Author
14 May 2009 3:41 AM
Colbert Zhou [MSFT]
Hello,

Is the issue resolved in your side? Any future assistance needed, please
feel free to update here.

Best regards,
Colbert Zhou (colbertz @online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msd***@microsoft.com.