NuGet config file name inconsistent when accessing via WSL UNC paths #13989
Labels
Area:Settings
NuGet.Config and related issues
Priority:3
Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog.
Product:dotnet.exe
Product:NuGet.exe
NuGet.exe
Type:Bug
NuGet Product Used
dotnet.exe, NuGet.exe
Product Version
9.0.101
Worked before?
Unknown
Impact
It bothers me. A fix would be nice
Repro Steps & Context
Describe the bug
On WSL Linux and Windows, with the project on the local filesystem,
dotnet nuget config paths
will consider a file namednuget.config
,NuGet.config
, orNuGet.Config
at the solution/project root.On Windows, accessing the project via WSL UNC paths or mapped drives,
dotnet nuget config paths
will only consider a file namedNuGet.Config
.The CLI tools should be consistent regarding which NuGet config filenames are considered regardless of paths or filesystems.
To Reproduce
In WSL, create a new project
Create a Nuget config file named
nuget.config
with the following content:In WSL, check that the NuGet config file will be considered:
In a Windows CMD or PowerShell prompt, navigate to the WSL directory:
In this case, I have mapped the root filesystem of my WSL distro to D: in Windows, since CMD doesn't support UNC paths. Using the full UNC path in PowerShell exhibits the same behaviour.
Check what config files NuGet will consider:
Rename the config file to "NuGet.Config":
Additionally, the public documentation regarding NuGet configs uses a mix of
NuGet.Config
andnuget.config
, making it unclear exactly which config filenames are supported by default:https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior
Verbose Logs
WSL Linux: $ dotnet --info .NET SDK: Version: 9.0.101 Commit: eedb237549 Workload version: 9.0.100-manifests.3068a692 MSBuild version: 17.12.12+1cce77968 Runtime Environment: OS Name: debian OS Version: 12 OS Platform: Linux RID: linux-x64 Base Path: /usr/share/dotnet/sdk/9.0.101/ .NET workloads installed: There are no installed workloads to display. Configured to use loose manifests when installing new manifests. Host: Version: 9.0.0 Architecture: x64 Commit: 9d5a6a9aa4 .NET SDKs installed: 9.0.101 [/usr/share/dotnet/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 9.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 9.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Other architectures found: None Environment variables: Not set global.json file: /home/paul/dev/sandbox/ctaip/global.json Learn more: https://aka.ms/dotnet/info Download .NET: https://aka.ms/dotnet/download
Windows 11:
The text was updated successfully, but these errors were encountered: