Search code examples
visual-studiovisual-studio-2017nugetnuget-packagevisual-studio-2019

Latest version of nuget package still not up to date


We are using our own nuget server on the local network. I've got a dotnet standard 2.0 library which I'm packaging via nuget. Currently it's at 1.0.5.4 (both File version and Assembly version).

However when I install it in another solution it's missing a property that I added in the latest version increment. When I F12 on a class of that nuget it reads at the top:

    #region Assembly lib-mycode-async, Version=1.0.5.1, Culture=neutral, PublicKeyToken=null
    // C:\Users\{Username}\.nuget\packages\lib.mycode\1.0.5.4\lib\netstandard2.0\lib-mycode-async.dll
    #endregion

In the nuget Manager GUI of Visual Studio it says 1.0.5.4 everywhere. I uninstalled the nuget from all projects of the solution,

  • uninstalled any other package that used that particular nuget
  • did Update-Package -reinstall to reinstall all nuget packages in the solution
  • closed and reopened Visual Studio (2019 but also remember having had this with 2017)
  • rebuild the nuget packages
  • cleaned the nuget package cache in Options > Nuget Package Manager > General > Clear All NuGet Cache(s)

Why does it appear to be up to date everywhere and still I cannot use the latest code changes?


Solution

  • While writing the question I followed the path in the meta data. The .dll file the path points to indeed had the version 1.0.5.1 so I deleted the entire folder lib.mycode in C:\Users\{Username}\.nuget\packages.

    I rebuild my solution, closed VS 2019 and reopened the solution.

    Now the folder was back but with the right version. The code was finally there which I added in the latest version of my nuget package.

    I really thought that this would have been taken care of by the last point I tried out in the question above!