Application.StartupPath on Windows 7

J

Joe Cool

Using Visual Studio 2008, C#.NET. How come referencing
Application.StartupPath on Windows 7 translates to:

c:\users\superuser\Documents\Visual Studio 2008\Projects\mySolution
\mySolution\bin\Debug

which does not exist, instead of:

c:\users\superuser\My Documents\Visual Studio 2008\Projects\mySolution
\mySolution\bin\Debug

which DOES exist?
 
F

Family Tree Mike

Using Visual Studio 2008, C#.NET. How come referencing
Application.StartupPath on Windows 7 translates to:

c:\users\superuser\Documents\Visual Studio 2008\Projects\mySolution
\mySolution\bin\Debug

which does not exist, instead of:

c:\users\superuser\My Documents\Visual Studio 2008\Projects\mySolution
\mySolution\bin\Debug

which DOES exist?

You never developed on Vista? The same thing happens there. It is
Folder Virtualization. It should not cause any issues for you unless
you hard code something.
 
P

Peter Duniho

Family said:
You never developed on Vista? The same thing happens there. It is
Folder Virtualization. It should not cause any issues for you unless
you hard code something.

Actually, while in this context the distinction is probably not
important, that's not actually folder virtualization. It's a feature
that's been around since XP in one form or another, in which the
Explorer-displayed names are not exactly the same as those found on the
file system. In particular, in the file system, the word "My" is not
found, but in Explorer is automatically pre-pended to certain special
folders.

Folder virtualization is new to Vista, and is part of the system that
allows software running under limited accounts to access file system
areas that would normally be restricted to them. The OS virtualizes the
folder, effectively giving the user a private copy of the folder, so
that the software can make changes without affecting any other user
accounts on the computer.

As far as the OP's question goes, the bottom line is that the _first_
path is the only one that does exist, while the latter path in reality
does not.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top