Skip to content

Pack, and several other code paths, fails dependant on locale. Use RegexOptions.CultureInvariant #8246

@ericstj

Description

@ericstj

NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe):
dotnet.exe

NuGet version (x.x.x.xxx):
5.2.0.6020

dotnet.exe --version (if appropriate):
3.0.100-preview6-012264

VS version (if appropriate):
n/a

OS version (i.e. win10 v1607 (14393.321)):
Ubuntu in WSL Version 10.0.18362 Build 18362

Worked before? If so, with which NuGet version:
don't know

Detailed repro steps so we can see the same problem

  1. Create a nuspec containing a file path with capital letters and pack with PackageBuilder.

Expect: pack succeeds.
Actual: failure to pack complaining file doesn't exist, though it does.

For more details see https://github.com/dotnet/corefx/issues/38608

Bug is here: https://github.com/NuGet/NuGet.Client/blob/686dd6b060639a0fb401eceb4c3a4029c1482023/src/NuGet.Core/NuGet.Common/PathUtil/PathResolver.cs#L90

It needs RegexOptions.CultureInvariant. Probably some other cases of the same bug https://github.com/NuGet/NuGet.Client/search?q=RegexOptions.IgnoreCase&unscoped_q=RegexOptions.IgnoreCase

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions