Is there a way to recreate the packages.config file?

I accidentally missed loading the package.config into the NuGet source code, and it somehow went away :(

Is there any way to recreate it?

+4
source share
2 answers

This is difficult to do in an automatic way. The easiest way is to simply recreate packages.configmanually the added entries for each directory in the directory packages. For example, I have the following directories in the package directory:

Microsoft.Bcl.1.1.3
Microsoft.Bcl.Async.1.0.16
Microsoft.Net.Http.2.2.15
Newtonsoft.Json.5.0.8
repositories.config
WindowsAzure.MobileServices.1.0.2
WPtoolkit.4.2013.08.16

If I were to re-create the package.config file, I could just take the directory name, separate the version number and create a line for each package, for example:

  <package id="Microsoft.Bcl" version="1.1.3" targetFramework="wp71" />

targetFramework , .

<package>

<?xml version="1.0" encoding="utf-8"?>
<packages>
 <!--...-->
</packages>

:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Microsoft.Bcl" version="1.1.3" targetFramework="wp71" />
  <package id="Microsoft.Bcl.Async" version="1.0.16" targetFramework="wp71" />
  <package id="Microsoft.Net.Http" version="2.2.15" targetFramework="wp71" />
  <package id="Newtonsoft.Json" version="5.0.8" targetFramework="wp71" />
  <package id="WindowsAzure.MobileServices" version="1.0.2" targetFramework="wp71" />
  <package id="WPtoolkit" version="4.2013.08.16" targetFramework="wp71" />
</packages>
+1

- Nuget . package.config

+4

All Articles