0
votes

I've created two NuGet package files

  • Foo.1.0.0.nupkg
  • Foo.1.0.1.nupkg

Both files are located in a folder on my PC, which I've configured as a package source in Visual Studio. I created a console app project which contains a NuGet.config file:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <config>
    <!-- 
    Used to specify the default location to expand packages.
    See: NuGet.exe help install
    See: NuGet.exe help update
    -->
    <add key="repositorypath" value="Packages" />
  </config>
  <packageRestore>
    <!-- Allow NuGet to download missing packages -->
    <add key="enabled" value="True" />

    <!-- Automatically check for missing packages during build in Visual Studio -->
    <add key="automatic" value="True" />
  </packageRestore>
  <packageSources>
    <add key="Confused NuGet Packages" value="D:\NuGet Packages" />
  </packageSources>
</configuration>

There is also a packages.config file associated with the solution, but there are no packages listed in that file, it's a blank canvas, which is fine.

When I look in the "Online" section in NuGet Package Manager, I can see both my custom packages, but regardless of which one I choose, when I click "Install" nothing happens. The package I choose is not installed.

Why is this?

Also, when I want to update a NuGet package, how can I do this and get the new package to appear in the "Updates" section of NuGet Package Manager? How can this be done?

1

1 Answers

0
votes

I'm not 100% sure if this is the answer, but I did the following and the result is that my NuGet packages now appear in the "Installed" section, as well as the "Update" section after I create a new package.

First, for the class library DLL file I was using in the package, I added it to the "lib" special folder in NuGet Package Manager.

Also I made sure that the AssemblyVersion and AssemblyFileVersion details in AssemblyInfo.cs were correct for each version of the class library. After doing these two steps, everything clicked into place.