mrward/monodevelop-nuget-addin

packages directory

tofutim opened this issue · 8 comments

Hi, is there a way to specify the packages directory so that it is not in the solution? (I have multiple slns sharing the packages.) To do this in Visual Studio, I use

 <config>
   <add key="repositoryPath" value="..\..\..\..\packages" />
 </config>

in my NuGet.config. Perhaps there is somewhere I can set this... am I correct that the Mono versino of nuget does not hunt for NuGet.Config? Or maybe it does?

Update. Bummer, I tried to copy a .nuget with a NuGet.config but seems like it got ignored...
Update2. In fact, it was not ignored at all, but I needed to flip the direction of the slashes.

  <config>
    <add key="repositoryPath" value="../../../../packages" />
  </config>

Nice. Now if I could only get Xamarin Studio to look in the right directory...

Thank you again for making this tool Matt.

Another hint for someone that ends up on this trail. You can have NuGet.config in your .nuget directory for your Xamarin Solution, but if you are sharing projects with VS, you should not have NuGet.targets or NuGet.exe in the .nuget folder, because it will trigger restore on build, which will of course fail.

Sorry, I'm going to re-open this for a bit. Restore works great and puts the packages in the right directory. But now the updates and installed are completely wonky, and old installations do not get removed. Any way this can be supported a bit better?

There is no explicit code in the addin that reads different NuGet.config files which is probably why this is not working.

Is there a place where the .config file could be read?

The packages folder is determined by the SolutionPackageRepositoryPath class. This just gets the solution directory and appends the 'packages' folder to it.

A quick look at the NuGet source code and it seems as though they look in several different places for the NuGet.config file.

The funny thing is that Restore actually restores the packages into the
right directory, but Install, Upgrade, etc. don't quite work right.

On Thu, Feb 6, 2014 at 11:49 AM, Matt Ward notifications@github.com wrote:

The packages folder is determined by the SolutionPackageRepositoryPathhttps://github.com/mrward/monodevelop-nuget-addin/blob/master/src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepositoryPath.csclass. This just gets the solution directory and appends the 'packages'
folder to it.

A quick look at the NuGet source code and it seems as though they look in
several different places for the NuGet.config file.

Reply to this email directly or view it on GitHubhttps://github.com//issues/41#issuecomment-34362936
.

The reason restore works is because it is using NuGet.exe. All the logic that Visual Studio has is repeated in there 😄

Install and upgrade are just using NuGet.Core which does not have this extra functionality.

This feature has been implemented and should hopefully be available in the next release of Xamarin Studio in version 5.2