1

On Asp.Net MVC4 when you create a project and download the nuget dependencies, it created a package.json with all the id and values for all dependencies you have installed. At the same time, a package folder was created at the root of your applications saving all your nuget packages. But this was customizable, you can choose to write a Nuget.config file to point all your nugets to a specific folder. The structure of that one looks like this.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <config>
    <add key="repositoryPath" value="$\..\MyFolderRepository\Packages" />
  </config>
</configuration>

With Asp.net core I don't have any clue of where those packages are saved. On the obj folder you can find the project.assets.json with all the configuration for your dependencies, but even with that, I can't figure out where are they stored. For example, bellow is the Automapper dependency configuration, but where is stored that magic lib folder? and how I can change the repository folder for my dependencies?

"version": 3,
  "targets": {
    ".NETCoreApp,Version=v2.0": {
      "AutoMapper/6.2.1": {
        "type": "package",
        "dependencies": {
          "Microsoft.CSharp": "4.3.0",
          "NETStandard.Library": "1.6.1",
          "System.Collections.Concurrent": "4.3.0",
          "System.Collections.Specialized": "4.3.0",
          "System.ComponentModel.TypeConverter": "4.3.0",
          "System.Dynamic.Runtime": "4.3.0",
          "System.Linq.Queryable": "4.3.0",
          "System.Reflection.Emit": "4.3.0",
          "System.Resources.ResourceManager": "4.3.0",
          "System.Runtime.Serialization.Primitives": "4.3.0",
          "System.Text.RegularExpressions": "4.3.0"
        },
        "compile": {
          "lib/netstandard1.3/AutoMapper.dll": {}
        },
        "runtime": {
          "lib/netstandard1.3/AutoMapper.dll": {}
        }
      },
Zinov
  • 3,817
  • 5
  • 36
  • 70
  • .NET Core saves packages in user workspace and it's like a local repo of packages for all your projects, i.e. more efficient space usage. However, I was unable to find a way to change the folder location so far. – Ignas Nov 22 '17 at 20:00
  • Possible duplicate of [Change NuGet package folders used by Visual Studio 2017](https://stackoverflow.com/questions/43541859/change-nuget-package-folders-used-by-visual-studio-2017) – Aeseir Nov 23 '17 at 01:25
  • Curious ... why do you want to change the default folder ? For offline use\re-use? – Muqeet Khan Nov 23 '17 at 02:52
  • 1
    @MuqeetKhan Why? => because I have another projects(more than 12 that are working) that are using a default share locations that are not the same .net core uses, at the same time all of them are part of a continuous deployment process, so changing the path of the package is not the best move and I assume that it should be a way to it as I did it with the Nuget.config – Zinov Nov 27 '17 at 01:07

0 Answers0