-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For a network drive, System.Windows.Forms.Application.StartupPath returns a path with \?UNC\ prefix #109846
Comments
We just return what the .NET runtime gives us for |
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov |
I repro this, looks to me like |
This is a regression likely caused by my change in #99576. In following the path to determine if it is a symbolic link the path was converted to a UNC path. My suspicion is that this can be fixed by also checking if the target path is a UNC path instead of just an extended path here but I haven't yet convinced myself that's all that's needed. |
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov |
Fixed? |
I just wanted to add that this issue also prevents any WPF app with a MediaElement from running from a UNC path. While resolving the Uri of the MediaElement.Source WPF passes the result of AppDomain.BaseDirectory to the Uri constructor, resulting in a UriFormatException because the Uri constructor can't deal with the \\?UNC\ prefix. This happens here: |
.NET version
9.0
Did it work in .NET Framework?
Yes
Did it work in any of the earlier releases of .NET Core or .NET 5+?
It worked in .NET 8
Issue description
System.Windows.Forms.Application.StartupPath returns a path with ?UNC\ prefix
Steps to reproduce
observe System.Windows.Forms.Application.StartupPath in Visual Studio debug mode.
The text was updated successfully, but these errors were encountered: