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

Add an API to get the path to the global packages folder #2403

Closed
joelverhagen opened this Issue Mar 25, 2016 · 5 comments

Comments

Projects
None yet
5 participants
@joelverhagen
Member

joelverhagen commented Mar 25, 2016

This is an ask by the dotnet CLI team so that they can depend on our code to find the global packages folder (rather that duplicating our logic which is prone to break in the future). This should be exposed in one of our existing NuGet.* packages.

Considerations:

  1. The global packages folder can be relative. If it is, it is relative to the solution directory (not the location of the NuGet.config).
  2. The value can come from a couple different places. The precedence is:
    1. The NUGET_PACKAGES environment variable.
    2. The globalPackagesFolder key in the settings.
    3. An OS-dependent machine-wide value (e.g. %USERPROFILE%\.nuget\packages for Windows)
  3. The directory separators (\ vs. /) be fixed up based on OS so that the caller does not have to do the fix up.

@joelverhagen joelverhagen added this to the 3.5 Beta milestone Mar 25, 2016

@emgarten

This comment has been minimized.

Show comment
Hide comment
@emgarten

emgarten Mar 28, 2016

Contributor

Related to: #2296

Contributor

emgarten commented Mar 28, 2016

Related to: #2296

@yishaigalatzer

This comment has been minimized.

Show comment
Hide comment
@yishaigalatzer

yishaigalatzer Apr 27, 2016

We also need this API for the build task to pick up

yishaigalatzer commented Apr 27, 2016

We also need this API for the build task to pick up

@rrelyea rrelyea modified the milestones: 3.5 Beta2, 3.5 RC Jun 9, 2016

@rrelyea rrelyea modified the milestones: 3.5 Beta3, 3.5 Beta2 Jun 14, 2016

@emgarten

This comment has been minimized.

Show comment
Hide comment
@emgarten

emgarten Jun 15, 2016

Contributor

The NuGetPathContext API handles this now.

NuGet/NuGet.Client@b5972d8

Contributor

emgarten commented Jun 15, 2016

The NuGetPathContext API handles this now.

NuGet/NuGet.Client@b5972d8

@emgarten emgarten closed this Jun 15, 2016

@qbikez

This comment has been minimized.

Show comment
Hide comment
@qbikez

qbikez Jun 29, 2016

Why the requirement that globalPackagesFolder should be relative to the solution directory? This seems counter-intuitive to me and differs from repositoryPath behavior. When running restore from commandline, the global packages folder will be different depending on current working directory.

qbikez commented Jun 29, 2016

Why the requirement that globalPackagesFolder should be relative to the solution directory? This seems counter-intuitive to me and differs from repositoryPath behavior. When running restore from commandline, the global packages folder will be different depending on current working directory.

@emgarten

This comment has been minimized.

Show comment
Hide comment
@emgarten

emgarten Jul 11, 2016

Contributor

@qbikez I agree and this behavior has been fixed for 3.5.0 RTM. globalPackagesFolder will be relative to the nuget.config file where it is defined now, the same as repositoryPath.

Contributor

emgarten commented Jul 11, 2016

@qbikez I agree and this behavior has been fixed for 3.5.0 RTM. globalPackagesFolder will be relative to the nuget.config file where it is defined now, the same as repositoryPath.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment