System.IO functions don't support paths in the form of \\?\Volume{GUID}\ - by thaimin

Status : 

  By Design<br /><br />
		The product team believes this item works according to its intended design.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 640815 Comments
Status Closed Workarounds
Type Bug Repros 1
Opened 2/1/2011 12:43:02 PM
Access Restriction Public


Most System.IO functions that take path names do not accept paths in the form \\?\Volume{GUID}\ but the similar native functions do support these. This is the only way to access partitions that do not have any mapped paths. These paths work fine in Explorer.

Some functions that don't actually look at the entire path work correctly (such as Path.GetExtension or Path.Combine) but most throw an exception.

I know that this at least effects the following, however it probably effects many more:
Sign in to post a comment.
Posted by Raphaël P on 4/26/2012 at 8:41 PM
Unfortunately, I don't think this problem only deserves a "this is by design" answer. This "design" prevents dotnet programs to access drives in many server scenarios (and even home scenarios I think: didn't a Windows home server version got rid of drive letters altogether?). The only alternative is to rewrite a lot of parts of System.IO. This is not only very expensive but also bugprone (lot of pinvoke code with many edge-cases to deal with).

Besides the given answer mention an obsolete blogpost (2007) for a similar problem (long names support) that has been fixed since then. Finally, while the reference to the LongPath library on Codeplex was a well-intended move, it is far to be a good enough code base developers could use to decently support guid-prefixed paths (3 classes, 10 public methods, no unit tests).

Just as you had to support long names, you now have to support
Posted by Microsoft on 4/4/2011 at 10:23 AM
Hello thaimin,
Thank you for your post. This behavior is by design with System.IO. Please see the following blog post and sample codeplex code which you can modify to support \\?\Volume{GUID}\ paths

1) BCL Blog post series on long path support

2) Long Path support library on BCL CodePlex
Posted by Microsoft on 2/1/2011 at 7:07 PM
Thanks for your feedback.
We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 2/1/2011 at 12:59 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(