Open hickford opened 1 month ago
@rainersigwald we don't do globbing/discovery from a drive root by design, right? Concerns with enumeration performance/user foot-guns?
No, we're not doing this on purpose. It works on .NET 9:
❯ ls *proj
Directory: S:\
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 8/20/2024 11:08 AM 0 build.proj
❯ msbuild
MSBuild version 17.12.0-preview-24412-02+0716e1c2a for .NET Framework
MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.
❯ dotnet msbuild -tl:off
MSBuild version 17.12.0-preview-24374-02+48e81c6f1 for .NET
S:\build.proj : error MSB4025: The project file could not be loaded. Root element is missing.
This looks like a bug in .NET Framework's System.IO.Directory.EnumerateFiles()
; check out the behavior of:
System.IO.Directory.SetCurrentDirectory(@"\");
var x = System.IO.Directory.GetFiles(".", "*.*proj");
System.Console.WriteLine(x.Length);
❯ .\play\io\bin\Debug\net472\io.exe
0
❯ .\play\io\bin\Debug\net6.0\io.exe
1
Issue Description
When run in root directory such as
C:\
, MSBuild can't find project fileSteps to Reproduce
c:\hello.proj
c:\
msbuild
Expected Behavior
MSBuild runs default target in project
c:\hello.proj
Actual Behavior
MSBuild shows error:
Versions & Configurations
MSBuild version 17.11.2+c078802d4 for .NET Framework 17.11.2.32701