NuGet restore question

Hello,

The new NuGet restore action is awesome. I no longer have to run NuGet.exe with custom parameters. I have a question though. I prefer to use this directory structure in my software:

doc
lib
src
tools

This means that all projects (and the sln file) is located in src. Therefore I have created a nuget.config that makes sure that I don't have a packages in the src folder, but NuGet uses the lib in the root (works much better in case you need to check in other libs that are not on NuGet).

The restore action says this though:


Would it be possible to follow the NuGet standards (or is this the NuGet standard)? What I would like to see is this behavior:

configFile = "%appdata%\NuGet\nuget.config" ;
if (slnFileSpecified)
{
string slnConfigFile = Path.Combine(slnDirectory, "nuget.config" );
if (File.Exists(slnConfigFile))
{
configFile = slnConfigFile;
}
}


Then I (and others?) can skip another input field :-)

Hi Geert, that’s great, we are happy to hear that your enjoying NuGet restores!

You can achieve this outcome by enabling NuGet restore on the solution (right click the solution and select ‘Enable NuGet Package Restore’), this will generate a number of files under a .nuget folder. You can then edit these files as required and check-in .nuget\NuGet.config and optionally .nuget\NuGet.targets (if you wish to enable auto restores vs msbuild) into your repository.

For example you could add something like this to your .nuget\NuGet.config:

<config>
  <add key=“repositoryPath” value="…\somecoolfolder" />
config>


Once this is done you will no longer need to provide a location for the Config file as part of the restore action.

For full details please refer to the NuGet config file documentation at http://docs.nuget.org/docs/reference/nuget-config-file

Please let me know how you go

Thanks.

Hi Pete,

Thanks for the info. The NuGet restore feature is deprecated. The only thing the NuGet team needs to do is to remove the menu item from the context menu (see https://nuget.codeplex.com/workitem/4019). I have already specified the nuget.config inside the same folder as the sln file. However, when you specify a solution file, nuget.exe does not respect the default behavior of checking the sln directory.

Hi Geet, no problems, we have implemented this change and its scheduled for the next build (at this stage early next week). Thanks again