-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-source argument is being ignored when installing a local nuget package into a .net core project. #5763
Comments
@michaelrenvl can you tell us the complete command you used to install the package? |
@jainaashish the complete command was: Install-Package SomeLocalPackage -Source C:\Users\Michael\Documents\Visual Studio 2017\Projects\LocalNuGet |
I have also encountered where For example, in the package manager console, executing Notice how line 2 reflects a call to nugget.org instead of myget.org, as was requested by
|
I've tested this with 4.0.0 and the behavior has not changed, so it's not a new regression. The behavior is the same among package reference (both legacy and netcore) and project.json projects. |
I can confirm the problem, when using Nuget Package Manager Console in VS 2017 15.4.4 the -Source option or full path to nuget package wasn't respected. Instead NuGet searched all my registered repos. |
same here. |
I'm wanting to provide users that submit issues to our repository an easy and simple way to install a new package generated by our CI that addresses the issue they are reporting. Example: https://github.com/ExtendedXmlSerializer/ExtendedXmlSerializer/pull/299#issuecomment-556035632 However, running the command results in the error message discussed in this issue. The interesting thing is that I was able to run it once on a clean project (that's how I got the command in the first place 😁) but now it generates the error after it has been installed. |
This is intentional and by design. After some discussion among the team, we've decided to keep things as they are. Thank you for your time filing this issue and for the healthy ongoing discussion! |
Remove the content above here and fill out details below.
Details about Problem
NuGet product used (Package Manager Console):
NuGet version (4.3.0.4339):
dotnet.exe --version (if appropriate): .net core 1.1
VS version (if appropriate): 15.3.0
OS version (win10 v1703 (15063.540)):
Worked before? If so, with which NuGet version: The version before the visual studio update that brought .net core 2.0.
Detailed repro steps so we can see the same problem
These steps assume that there is a .net core 1.1 project currently loaded in Visual studio 2017 with the update that brought .net core 2.0.
Create a nuget package from a project (in my case a .net core class library targeting core 1.1 configured to output a nuget package).
Do NOT upload this to any server, instead copy it to a local folder from which you will manually install this in a .net core project.
In the project that gets the package installed use this command: "Install-Package -Source ". It fails with the message that it can't locate the source.
Add that path to the NuGet package manager settings and install the package again using the same command.
The installation will succeed and that path can be safely removed from the settings.
Increase the version number of the package and build it again. But without adding the path to the settings.
If you try to install the package now it will fail with the message that it can't find the path.
Add that path to the settings and it will be able to install the package again until you remove it from the settings and increase the version number.
Suggested things
It looks like it is ignoring the -Source parameter.
Verbose Logs
Please include verbose logs (NuGet.exe -verbosity detailed | dotnet.exe --verbosity diag | etc...)
Restoring packages for
...
GET https://api.nuget.org/v3-flatcontainer/nugetpackage/index.json
GET https://nuget.renvl.nl/api/odata/FindPackagesById()?id='NuGetPackage'
OK https://nuget.renvl.nl/api/odata/FindPackagesById()?id='NuGetPackage' 70ms
NotFound https://api.nuget.org/v3-flatcontainer/nugetpackage/index.json 471ms
Install-Package : Unable to find package NuGetPackage. No packages exist with this id in source(s): C:\Program Files\dotnet\sdk\NuGetFallbackFolder, Microsoft Visual Studio Offline Packages, nuget.org, RvlLibrary
At line:1 char:1
Install-Package : Package restore failed. Rolling back package changes for 'Project'.
At line:1 char:1
The text was updated successfully, but these errors were encountered: