Nuget update command result differs from Visual Studio's (Package Manager) update

Viewed 20

I have a package (MyPackage) installed in a given project.

If I update it with Visual Studio (Manage Nuget Packages) or with Update-Package command, such as:

Update-Package -Id MyPackage -Version 1.2.8-bla

The target project's csproj entry for this package looks like:

<Reference Include="MyPackage, Version=1.2.7.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\..\..\packages\MyPackage.1.2.8-bla\lib\net48\MyPackage.dll</HintPath>
</Reference>

But if I update it using nuget update command such as:

nuget update path_to_csproj -Id MyPackage -Version 1.2.8-bla

Then I get:

<Reference Include="MyPackage, Version=1.2.7.0, Culture=neutral, PublicKeyToken=null">
  <HintPath>..\..\..\packages\MyPackage.1.2.8-bla\lib\net48\MyPackage.dll</HintPath>
  <Private>True</Private>
</Reference>

The nuget update command:

  • Adds <Private>True</Private>
  • Adds PublicKeyToken=null
  • Removes processorArchitecture=MSIL

I'd like to understand why and know how I can get the same result I get with Package Manager but using nuget update command.

0 Answers
Related