IVsPackageInstaller.InstallPackage fails to install package from source not included in NuGet.config #7104
Labels
Functionality:SDK
The NuGet client packages published to nuget.org
Priority:2
Issues for the current backlog.
Product:VS.Client
Style:PackageReference
Type:Feature
Milestone
In VS2017 15.7.4, calling IVsPackageInstaller.InstallPackage with an on-disk source fails.
Steps to reproduce the behavior:
(1) Find or create a nupkg that's not available in any package source specified in %appdata%\nuget\nuget.config.
(2) nuget.exe add that nupkg to C:\temp\packages.
(3) Ensure that C:\temp\packages is not a package source listed in %appdata%\nuget\nuget.config.
(4) Create an ASP.NET Core web application project (targeting .NET Core 2.0).
(5) Author a VS extension to call IVsPackageInstaller.InstallPackage with source="C:\temp\packages" and project=the project created in (4).
(6) Run the VS extension.
Expected result:
Nuget finds and installs the package from C:\temp\packages.
Actual result:
Nuget fails to find the package and the operation fails with an exception - "Package restore failed. Rolling back package changes for 'Web1'." The LogMessage will show that it was unable to find the package and will show that it searched every package source in %appdata%\nuget\nuget.config.
The text was updated successfully, but these errors were encountered: