Installing NuGet package located in local package repository into a new Visual Studio Solution

后端 未结 1 1323
我在风中等你
我在风中等你 2020-12-07 05:54

UPDATE: Apparently providing too much pre-amble adds more confusion that clarity, so here\'s my question:

How do I add packages to a project from the local p

相关标签:
1条回答
  • 2020-12-07 06:29

    How do I add packages to a project from the local packages repository (i.e. not the central NuGet repository) when there are no references to them in the current solution and thus they do not show up as installed in the "Manage Package for Solutions" window.

    Not sure if I completely understand your problem correctly, if not, please let me know for free.

    To resolve this issue, you can create a local feed for those packages, so that you can see those packages in the Manage Package for Solutions and add them to their respective projects and have NuGet create the packages.config file for the project even if you don't have them installed.

    • Add those packages .nupkg into your local repository folder (Including those versions that are no longer available on the NuGet repository).
    • Head into Visual Studio and open the NuGet Settings dialog via Tools > NuGet Package Manager > Package Manager Settings. Click the Package Sources tab within the settings dialog, followed by the plus icon in the top left to add a new package source.
    • Enter the Name and Source of your local repository. The name can be any string and will be the name displayed in the NuGet Package Manager within Visual Studio.

    Now that you have added the local package source, you will be able to use your local repository from within Visual Studio in the usual way, either via the Console or via the Package Dialog, by selecting it from the Package Source menu:

    Hope this helps.

    0 讨论(0)
提交回复
热议问题