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

Update cli doesn't work on .net standard/core csproj #4945

Closed
trampster opened this issue Mar 30, 2017 · 5 comments
Closed

Update cli doesn't work on .net standard/core csproj #4945

trampster opened this issue Mar 30, 2017 · 5 comments
Milestone

Comments

@trampster
Copy link

Details about Problem

NuGet.exe 4.0.0.2283

Detailed repro steps so we can see the same problem

  1. Create a .net standard csproj
  2. Install a nuget package (not the latest)
  3. Run NuGet update YouProject.csproj
    Expected: PackageReference updated to the lastest
    Actual: Unable to update. The project does not contain a packages.config file.

.net standard/core projects don't have packages.config, This is all now in the csproj file.

VerboseLogs:
NuGet Version: 4.0.0.2283
MSBuild auto-detection: using msbuild version '15.1.548.43366' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\bin'. Use option -MSBuildVersion to force nuget to use a specific version of MSBuild.
Looking for installed packages in '..\packages'.
System.AggregateException: One or more errors occurred. ---> NuGet.CommandLine.CommandLineException: Unable to update. The project does not contain a packages.config file.
at NuGet.CommandLine.UpdateCommand.d__50.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.CommandLine.UpdateCommand.d__43.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at NuGet.CommandLine.Command.Execute()
at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)
---> (Inner Exception #0) NuGet.CommandLine.CommandLineException: Unable to update. The project does not contain a packages.config file.
at NuGet.CommandLine.UpdateCommand.d__50.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.CommandLine.UpdateCommand.d__43.MoveNext()<---

@matkoch
Copy link
Contributor

matkoch commented Apr 14, 2017

I know it's not clearly stated, but with blog posts like NuGet is now fully integrated into MSBuild you're suggesting that it would do exactly that - working fully. That's why it's very disappointing to find out that an essential command like update doesn't work.

@ChipRadon
Copy link

Run into the same problem, seems there is no way to update core projects with latest packages outside visual studio, kinda blocker for us.

@Lexcess
Copy link

Lexcess commented Jun 21, 2017

We're using this to automate testing of newly created packages (after pushing to an internal feed). Works perfectly for Framework projects, broken as described above for .NET Core. Really disappointing to not even see a response on this since March.

@emgarten emgarten added this to the 4.5 milestone Oct 17, 2017
@emgarten
Copy link
Member

Use dotnet add to update a PackageReference version. There is currently no plan to duplicate these commands in nuget.exe.

Related: #4103

@dationguyen
Copy link

is there any update on this :(
I have 20 projects 6 of them using same nuget package, 14 else is not.
i used to use this cli to update them all
find . -name "*.csproj" -execdir nuget update -id {packagename} -Source ${SOURCE} {} ;

dotnet add will not work in this case. it will just add new package to every project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants