RicoSuter / NuGetReferenceSwitcher

Visual Studio extension to switch between NuGet and project references.
http://nugetreferenceswitcher.org
Microsoft Public License
208 stars 69 forks source link

Support for Nuget.config with repositoryPath #14

Open danielcbock opened 8 years ago

danielcbock commented 8 years ago

If we have a nuget.config file with a repositoryPath for a directory than is not named "packages" the nuget package references are not recognized as nuget package references and you are not presented with the option to change them to project references.

Here is a Nuget.Config that I have for my solution:

. . I see in the ProductModel.cs (LoadReferences method) the Path of the vsReference (e.g. does it contain "\packages\" in the path) is used to determine if a reference is from a nuget package. If a directory other than "packages" (the default) is used then you don't get the option to switch those references to project references. A simple option would be to let the user specify a regular express or at least a string to use. Another more complicated option would be to search for a nuget.config and see if it has a repositoryPath.
danielcbock commented 8 years ago

I don't think nuget.config appeared in original comment:

<configuration> <config&gt <add key="repositorypath" value="......\NuGetPackages" /&gt </config&gt

codefox42 commented 8 years ago

I agree with @danielcbock, same situation here (using a shared packages directory for multiple solution via a custom repositorypath in a NuGet.config in some parent directory).

Leon99 commented 8 years ago

+1