Open Aniobodo opened 2 weeks ago
The issue can reproduce .NET 9.0 & latest .NET 10.0 as below screenshot.
We just return what the .NET runtime gives us for AppContext.BaseDirectory
.
Tagging subscribers to this area: @vitek-karas, @agocke, @vsadov See info in area-owners.md if you want to be subscribed.
I repro this, looks to me like AppContext.BaseDirectory
is just returning Assembly.GetEntryAssembly()?.Location
which also shows this change. Seems that just returns the path that was passed in when loading - so this is either a change to the loader or the host that caused this.
This is a regression likely caused by my change in https://github.com/dotnet/runtime/pull/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 See info in area-owners.md if you want to be subscribed.
.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.