Skip to content

dotnet workload install should normalize pack directory name to lower case  #17438

@grendello

Description

@grendello

dotnet workload install should normalize pack directory name to lower case

Original issue:

I discovered that even though the Xamarin.Android templates package (named Microsoft.Android.Templates.11.0.200-ci.main.216.nupkg) was installed in dotnet/template-packs, it wasn't considered by dotnet new. After running dotnet under strace, I found that it checks for the presence of the following packages in template-packs (apparently hardcoded?):

$ grep template-packs dotnet.log.381805 | grep lstat
lstat("dotnet/template-packs/microsoft.macos.templates.11.1.100-preview.3.1379.nupkg", 0x7f6864ce3350) = -1 ENOENT (No such file or directory)
lstat("dotnet/template-packs/microsoft.macos.templates.11.1.100-preview.3.1379.nupkg", 0x7f6864ce33d0) = -1 ENOENT (No such file or directory)
lstat("dotnet/template-packs/microsoft.android.templates.11.0.200-ci.main.216.nupkg", 0x7f6864ce3350) = -1 ENOENT (No such file or directory)
lstat("dotnet/template-packs/microsoft.android.templates.11.0.200-ci.main.216.nupkg", 0x7f6864ce33d0) = -1 ENOENT (No such file or directory)
lstat("dotnet/template-packs/microsoft.ios.templates.14.4.100-preview.3.1326.nupkg", 0x7f6864ce3350) = -1 ENOENT (No such file or directory)
lstat("dotnet/template-packs/microsoft.ios.templates.14.4.100-preview.3.1326.nupkg", 0x7f6864ce33d0) = -1 ENOENT (No such file or directory)
lstat("dotnet/template-packs/microsoft.maccatalyst.templates.14.3.100-preview.3.471.nupkg", 0x7f6864ce3350) = -1 ENOENT (No such file or directory)
lstat("dotnet/template-packs/microsoft.maccatalyst.templates.14.3.100-preview.3.471.nupkg", 0x7f6864ce33d0) = -1 ENOENT (No such file or directory)
lstat("dotnet/template-packs/microsoft.tvos.templates.14.3.100-preview.3.1379.nupkg", 0x7f6864ce3350) = -1 ENOENT (No such file or directory)
lstat("dotnet/template-packs/microsoft.tvos.templates.14.3.100-preview.3.1379.nupkg", 0x7f6864ce33d0) = -1 ENOENT (No such file or directory)

Copying our package to the dotnet/templates/ directory or renaming it to all lower case in dotnet/template-packs made dotnet new show the templates defined there.

I think for the best cross-platform support, dotnet new should perform a case-insensitive check for the presence of template packages.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions