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

Comments

Projects
None yet
4 participants
@phenixdotnet

phenixdotnet commented Apr 22, 2016

Initially reported at dotnet/cli#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

This comment has been minimized.

Show comment
Hide comment
@emgarten

emgarten Apr 22, 2016

Contributor

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

Contributor

emgarten commented Apr 22, 2016

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