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

nuget update still fails for new csproj format #6382

Closed
nietras opened this issue Jan 4, 2018 · 6 comments
Closed

nuget update still fails for new csproj format #6382

nietras opened this issue Jan 4, 2018 · 6 comments
Labels
WaitingForCustomer Applied when a NuGet triage person needs more info from the OP

Comments

@nietras
Copy link

nietras commented Jan 4, 2018

When will this be resolved? What if one needs to use the PackageReference and cannot use packages.config?

Details about Problem

Running:

nuget.exe update NewCsproj.csproj

fails with

Unable to update. The project does not contain a packages.config file.

NuGet Version: 4.4.1.4656
VS version (if appropriate): 15.5.2
MSBuild version: 15.5.180.51428 for .NET Framework
OS version (i.e. win10 v1607 (14393.321)): win10

Detailed repro steps so we can see the same problem

  1. Run nuget.exe update on any new csproj file with PackageReference e.g.:
  <ItemGroup>
    <PackageReference Include="SomeNugetPackage" Version="1..0.0-alpha" />
  </ItemGroup>
@zhili1208
Copy link
Contributor

Could you try donet Cli: https://github.com/dotnet/cli ? "donet add [csproj] package [packageName]", it should update the package for PackageReference.

@zhili1208 zhili1208 added the WaitingForCustomer Applied when a NuGet triage person needs more info from the OP label Jan 8, 2018
@Indomitable
Copy link

Hi, I have two classic .csproj projects that use PackageReference both do not have packages.config file on one of them nuget update works, on the other it fails with "Unable to update. The project does not contain a packages.config file."
When Nuget searches for packages.config file ?

@AngelosP
Copy link

@zhili1208 any updates on this? Here is the current behavior:

The command doesn't fail or give any warnings:
image

But if you go back into Visual Studio it's clear that certain projects were completely skipped and are still referencing the old version of the component:
image

@jainaashish
Copy link
Contributor

NuGet.exe commands like install or update aren't supported for PackageReference based projects. They are only supported for packages.config based projects. Instead please use dotnet add to add or update packages for PackageReference for now. And we also have a open workitem #4103 to explicitly support dotnet update command. So you can upvote on that existing issue.

@nietras
Copy link
Author

nietras commented Feb 20, 2018

dotnet add NewCsproj.csproj package SomeNugetPackage

does not update. If say 1.2.4 is installed, and a 1.2.5 is available then this command will not update to 1.2.5. If however I write:

dotnet add NewCsproj.csproj package SomeNugetPackage -v 1.2.5

It will change to 1.2.5. But I can't do that in my scenario, I need to update to latest version.

@nietras
Copy link
Author

nietras commented Feb 20, 2018

What you can do then is to remove and then update:

dotnet remove NewCsproj.csproj package SomeNugetPackage
dotnet add NewCsproj.csproj package SomeNugetPackage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WaitingForCustomer Applied when a NuGet triage person needs more info from the OP
Projects
None yet
Development

No branches or pull requests

5 participants