Handle empty paths when locating extensions#7145
Conversation
Signed-off-by: Michael Kriese <michael.kriese@gmx.de>
This comment was marked as resolved.
This comment was marked as resolved.
|
@viceice nice find! the PR’s one-line change is perfectly fine for a stable, low-risk backport. |
thanks. is there anything i can / should do? |
|
@viceice thanks for the fix. The proposed changes look good to me. A couple of follow-ups before we merge:
https://github.com/NuGet/NuGet.Client/blob/dev/CONTRIBUTING.md#build has all the required information to build the nuget.exe locally with this change for manual validation. |
$ .\artifacts\VS15\NuGet.exe help
NuGet Version: 7.5.0.65534
usage: NuGet <command> [args] [options]
Type 'NuGet help <command>' for help on a specific command.
Available commands:
add Adds the given package to a hierarchical source. http sources are not supported. For more info, goto https://docs.nuget.org/consume/command-line-reference#add-command.
client-certs Provides the ability to manage list of client certificates located in NuGet.config files
config Gets or sets NuGet config values.
delete Deletes a package from the server.
eula Display NuGet.exe's End User Liscence Agreement (EULA)
help (?) Displays general help information and help information about other commands.
init Adds all the packages from the <srcPackageSourcePath> to the hierarchical <destPackageSourcePath>. http feeds are not supported. For more info, goto https://docs.nuget.org/consume/command-line-reference#init-command.
install Installs a package using the specified sources. If no sources are specified, all sources defined in the NuGet configuration file are used. If the configuration file specifies no sources, uses the default NuGet feed.
list Displays a list of packages from a given source. If no sources are specified, all sources defined in %AppData%\NuGet\NuGet.config are used. If NuGet.config specifies no sources, uses the default NuGet feed.
locals Clears or lists local NuGet resources such as http requests cache, temp cache or machine-wide global packages folder.
pack Creates a NuGet package based on the specified nuspec or project file.
push Pushes a package to the server and publishes it.
NuGet's default configuration is obtained by loading %AppData%\NuGet\NuGet.config, then loading any nuget.config or .nuget\nuget.config starting from root of drive and ending in current directory.
restore Restores NuGet packages.
search Searches a given source using the query string provided. If no sources are specified, all sources defined in %AppData%\NuGet\NuGet.config are used.
setApiKey Saves an API key for a given server URL. When no URL is provided API key is saved for the NuGet gallery.
sign Signs a NuGet package with the specified certificate.
sources Provides the ability to manage list of sources located in NuGet.config files.
spec Generates a nuspec for a new package. If this command is run in the same folder as a project file (.csproj, .vbproj, .fsproj), it will create a tokenized nuspec file.
trusted-signers Provides the ability to manage the list of trusted signers.
update Update packages to latest available versions. This command also updates NuGet.exe itself.
verify Verifies a signed NuGet package.
For more information, visit https://docs.nuget.org/docs/reference/command-line-reference$ mkbundle -o nuget --simple artifacts/VS15/NuGet.exe --machine-config /etc/mono/4.5/machine.config --config /etc/mono/config -L /lib/mono/4.5/Facades/
Using runtime: /usr/bin/mono
Assembly: /mnt/c/Users/kriese/projects/gh/viceice/nuget-NuGet.Client/artifacts/VS15/NuGet.exe
Config: /mnt/c/Users/kriese/projects/gh/viceice/nuget-NuGet.Client/artifacts/VS15/NuGet.exe.config
Assembly: /usr/lib/mono/4.5/mscorlib.dll
Assembly: /usr/lib/mono/4.5/System.Core.dll
Assembly: /usr/lib/mono/4.5/System.dll
Assembly: /usr/lib/mono/4.5/System.Configuration.dll
Assembly: /usr/lib/mono/4.5/System.Xml.dll
Assembly: /usr/lib/mono/4.5/System.Security.dll
Assembly: /usr/lib/mono/4.5/System.Numerics.dll
Assembly: /usr/lib/mono/4.5/Mono.Security.dll
Assembly: /usr/lib/mono/4.5/System.Xml.Linq.dll
Assembly: /usr/lib/mono/4.5/System.ComponentModel.Composition.dll
Assembly: /usr/lib/mono/4.5/Microsoft.CSharp.dll
Assembly: /usr/lib/mono/4.5/System.Net.Http.dll
Assembly: /lib/mono/4.5/Facades/netstandard.dll
Assembly: /usr/lib/mono/4.5/System.Data.dll
Assembly: /usr/lib/mono/4.5/System.Transactions.dll
Assembly: /usr/lib/mono/4.5/System.EnterpriseServices.dll
Assembly: /usr/lib/mono/4.5/System.Data.DataSetExtensions.dll
Assembly: /usr/lib/mono/4.5/System.Drawing.dll
Assembly: /usr/lib/mono/4.5/System.IO.Compression.dll
Assembly: /usr/lib/mono/4.5/System.IO.Compression.FileSystem.dll
Assembly: /usr/lib/mono/4.5/System.Runtime.Serialization.dll
Assembly: /usr/lib/mono/4.5/System.ServiceModel.Internals.dll
Assembly: /usr/lib/mono/4.5/System.Web.dll
Assembly: /usr/lib/mono/4.5/System.Web.ApplicationServices.dll
Assembly: /usr/lib/mono/4.5/System.Runtime.Serialization.Formatters.Soap.dll
Assembly: /usr/lib/mono/4.5/System.Web.Services.dll
Assembly: /usr/lib/mono/4.5/System.Design.dll
Assembly: /usr/lib/mono/4.5/System.Windows.Forms.dll
Assembly: /usr/lib/mono/4.5/Mono.WebBrowser.dll
Assembly: /usr/lib/mono/4.5/Mono.Posix.dll
Assembly: /usr/lib/mono/4.5/Accessibility.dll
Assembly: /usr/lib/mono/4.5/System.DirectoryServices.dll
Assembly: /usr/lib/mono/4.5/Novell.Directory.Ldap.dll
Assembly: /usr/lib/mono/4.5/Mono.Data.Sqlite.dll
Assembly: /usr/lib/mono/4.5/System.ComponentModel.DataAnnotations.dll
Assembly: /usr/lib/mono/4.5/Microsoft.Build.Utilities.v4.0.dll
Assembly: /usr/lib/mono/4.5/Microsoft.Build.Framework.dll
Assembly: /usr/lib/mono/4.5/System.ServiceModel.dll
Assembly: /usr/lib/mono/4.5/System.IdentityModel.dll
Assembly: /usr/lib/mono/4.5/System.Messaging.dll
Assembly: /usr/lib/mono/4.5/Mono.Messaging.dll
Assembly: /usr/lib/mono/4.5/System.Configuration.Install.dll
Assembly: /usr/lib/mono/4.5/System.ServiceModel.Activation.dll
Assembly: /usr/lib/mono/4.5/System.IdentityModel.Selectors.dll
Assembly: /usr/lib/mono/4.5/WindowsBase.dll
Assembly: /usr/lib/mono/4.5/System.Xaml.dll
Assembly: /usr/lib/mono/4.5/System.Data.Services.Client.dll
Assembly: /usr/lib/mono/4.5/I18N.West.dll
Assembly: /usr/lib/mono/4.5/I18N.dll
systemconfig: /etc/mono/config
machineconfig: /etc/mono/4.5/machine.config
Generated nuget
$ ./nuget help
NuGet.exe
$ ./nuget search nuget.commandline -Take 1
====================
Source: dotnet-eng
--------------------
No results found.
--------------------
====================
Source: dotnet-public
--------------------
> NuGet.CommandLine | 7.3.0 | Downloads: N/A
NuGet Command Line Interface.
--------------------
====================
Source: dotnet-libraries
--------------------
No results found.
--------------------
====================
Source: myget-legacy@Local
--------------------
No results found.
--------------------
====================
Source: nuget-build
--------------------
No results found.
--------------------
====================
Source: vside
--------------------
No results found.
--------------------
$ mono artifacts/VS15/NuGet.exe help
NuGet Version: 7.5.0.65534
usage: NuGet <command> [args] [options]
Type 'NuGet help <command>' for help on a specific command.
Available commands:
add Adds the given package to a hierarchical source. http sources are not supported. For more info, goto https://docs.nuget.org/consume/command-line-reference#add-command.
client-certs Provides the ability to manage list of client certificates located in NuGet.config files
config Gets or sets NuGet config values.
delete Deletes a package from the server.
eula Display NuGet.exe's End User Liscence Agreement (EULA)
help (?) Displays general help information and help information about other commands.
init Adds all the packages from the <srcPackageSourcePath> to the hierarchical <destPackageSourcePath>. http feeds are not supported. For more info, goto https://docs.nuget.org/consume/command-line-reference#init-command.
install Installs a package using the specified sources. If no sources are specified, all sources defined in the NuGet configuration file are used. If the configuration file specifies no sources, uses the default NuGet feed.
list Displays a list of packages from a given source. If no sources are specified, all sources defined in %AppData%\NuGet\NuGet.config are used. If NuGet.config specifies no sources, uses the default NuGet feed.
locals Clears or lists local NuGet resources such as http requests cache, temp cache or machine-wide global packages folder.
pack Creates a NuGet package based on the specified nuspec or project file.
push Pushes a package to the server and publishes it.
NuGet's default configuration is obtained by loading %AppData%\NuGet\NuGet.config, then loading any nuget.config or .nuget\nuget.config starting from root of drive and ending in current directory.
restore Restores NuGet packages.
search Searches a given source using the query string provided. If no sources are specified, all sources defined in %AppData%\NuGet\NuGet.config are used.
setApiKey Saves an API key for a given server URL. When no URL is provided API key is saved for the NuGet gallery.
sign Signs a NuGet package with the specified certificate.
sources Provides the ability to manage list of sources located in NuGet.config files.
spec Generates a nuspec for a new package. If this command is run in the same folder as a project file (.csproj, .vbproj, .fsproj), it will create a tokenized nuspec file.
trusted-signers Provides the ability to manage the list of trusted signers.
update Update packages to latest available versions. This command also updates NuGet.exe itself.
verify Verifies a signed NuGet package.
For more information, visit https://docs.nuget.org/docs/reference/command-line-referencenot sure why it doesn't show the expected help 🤔 maybe more bugs |
|
@viceice thanks for your response.
Does this statement mean that the proposed changes didn't work as expected or there are other bugs that you have noticed unrelated to this change. If there are other bugs, can you please add more information with expected vs actual behavior? |
|
that seems to be another bug, I'll file it separately when I've analyzed the cause. so this fix works as intended |
Bug
Description
Assembly.Locationcan return inly the assembly name and then the result is an empty path string.This especially happens when you try to bundle with mono (
mkbundle).PR Checklist