fluter
fluter

Reputation: 13846

How to use local packages for all projects

How can I setup a local packages folder for all projects, I found every uwp project is asking this and I had to install it for each time I am building a new project. This package is already installed in C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\, but it looks visual studio is not using it. How can I let it use local packages?enter image description here

Build error:

Type universe cannot resolve assembly: System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
Cannot resolve Assembly or Windows Metadata file 'System.Runtime.dll'       

Upvotes: 0

Views: 478

Answers (1)

Weiwei
Weiwei

Reputation: 3776

We could not setup a local packages folder for all projects. Because in every project, the packages.config file used to manage what packages that installed on current project.

The C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\ folder is not means the packages that installed in your projects. This folder is a cache for all packages that installed before.

When packages installing on your project, it will be downloaded to two folder, one is packages folder which is under your solution folder and another is Microsoft SDKs\NuGetPackages folder.

The Microsoft SDKs\NuGetPackages folder will be used when your computer doesn't have network but you want install some packages that has been installed before from internet.

So if you want to install the same packages for different projects, please save a packages.config file and add this file into projects. Then run following command in Package Manager Console window to reinstall these packages to your projects.

update-package -reinstall

Upvotes: 1

Related Questions