Skip to content
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

[dotnet restore] --configfile is relative to project dir instead of the cmd dir #2639

Closed
phenixdotnet opened this issue Apr 22, 2016 · 1 comment
Assignees
Labels
Milestone

Comments

@phenixdotnet
Copy link

Initially reported at https://github.com/dotnet/cli/issues/2599

Steps to reproduce

Assume this solution structure:

  • MySol
    • nuget.config
    • src
      • MyProject

Open a cmd prompt and move to MySol directory

Expected behavior

Relative path are evaluated from the current prompt directory and not from the project directory

Actual behavior

When running dotnet restore --configfile .\nuget.config from a cmd in MySol dir the command fail with this output:
error: File 'c:\dev\MySol\src\MyProject\.\nuget.config' does not exist.

Environment data

dotnet --info output:
.NET Command Line Tools (1.0.0-rc2-002439)

Product Information:
Version: 1.0.0-rc2-002439
Commit Sha: ef0c3b2cee

Runtime Environment:
OS Name: Windows
OS Version: 10.0.14316
OS Platform: Windows
RID: win10-x64

@emgarten
Copy link
Member

It looks like the path is resolved against the project path because that is the root for settings. RestoreArgs should resolve the full path of the argument before passing it into settings.

https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Commands/RestoreCommand/RequestFactory/RestoreArgs.cs#L63

@rrelyea rrelyea added this to the 3.5 RC milestone Apr 25, 2016
zhili1208 added a commit to NuGet/NuGet.Client that referenced this issue May 3, 2016
@zhili1208 zhili1208 modified the milestones: 3.5 Beta2, 3.6 Beta Jun 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants