Skip to content

nuget cli should handle empty paths when locating extensions #14764

@viceice

Description

@viceice

NuGet Product Used

NuGet.exe

Product Version

7.3.0.70

Worked before?

no working version

Impact

It's more difficult to complete my work

Repro Steps & Context

On linux:

  1. install mono-devel
  2. donwload nuget.exe
  3. run mkbundle -o nuget --simple nuget.exe --machine-config /etc/mono/4.5/machine.config --config /etc/mono/config -L /lib/mono/4.5/Facades/
  4. run ./nuget help and see the error

Verbose Logs

./nuget help -verbosity detailed
The specified path is not of a legal form (empty).
System.ArgumentException: The specified path is not of a legal form (empty).
  at System.IO.Path.InsecureGetFullPath (System.String path) [0x0002c] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
  at System.IO.Path.GetFullPath (System.String path) [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
  at System.IO.Enumeration.FileSystemEnumerator`1[TResult]..ctor (System.String directory, System.IO.EnumerationOptions options) [0x0002a] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
  at System.IO.Enumeration.FileSystemEnumerable`1+DelegateEnumerator[TResult]..ctor (System.IO.Enumeration.FileSystemEnumerable`1[TResult] enumerable) [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
  at System.IO.Enumeration.FileSystemEnumerable`1[TResult]..ctor (System.String directory, System.IO.Enumeration.FileSystemEnumerable`1+FindTransform[TResult] transform, System.IO.EnumerationOptions options) [0x0004b] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
  at System.IO.Enumeration.FileSystemEnumerableFactory.UserFiles (System.String directory, System.String expression, System.IO.EnumerationOptions options) [0x00014] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
  at System.IO.Directory.InternalEnumeratePaths (System.String path, System.String searchPattern, System.IO.SearchTarget searchTarget, System.IO.EnumerationOptions options) [0x00045] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
  at System.IO.Directory.EnumerateFiles (System.String path, System.String searchPattern, System.IO.EnumerationOptions enumerationOptions) [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
  at System.IO.Directory.EnumerateFiles (System.String path, System.String searchPattern) [0x00007] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
  at NuGet.CommandLine.ExtensionLocator.FindAll (System.String globalRootDirectory, System.Collections.Generic.IEnumerable`1[T] customPaths, System.String assemblyPattern, System.String nugetDirectoryAssemblyPattern) [0x00089] in <cb3208dd735a4541955a929976aa333e>:0
  at NuGet.CommandLine.ExtensionLocator.FindExtensions (NuGet.Common.IEnvironmentVariableReader environmentVariableReader) [0x0000c] in <cb3208dd735a4541955a929976aa333e>:0
  at NuGet.CommandLine.ExtensionLocator.FindExtensions () [0x00005] in <cb3208dd735a4541955a929976aa333e>:0
  at NuGet.CommandLine.Program.AddExtensionsToCatalog (System.ComponentModel.Composition.Hosting.AggregateCatalog catalog, NuGet.CommandLine.IConsole console) [0x00005] in <cb3208dd735a4541955a929976aa333e>:0
  at NuGet.CommandLine.Program.Initialize (NuGet.IFileSystem fileSystem, NuGet.CommandLine.IConsole console) [0x00052] in <cb3208dd735a4541955a929976aa333e>:0
  at NuGet.CommandLine.Program.MainCore (System.String workingDirectory, System.String[] args, NuGet.Common.IEnvironmentVariableReader environmentVariableReader) [0x000c6] in <cb3208dd735a4541955a929976aa333e>:0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions