tag:help.appveyor.com,2012-11-13:/discussions/questions/26881-nuget-restore-and-cachingAppVeyor: Discussion 2018-12-01T21:00:34Ztag:help.appveyor.com,2012-11-13:Comment/461484372018-09-25T17:22:08Z2018-09-25T17:22:08ZNuget restore and caching<div><p>Are you saying that you are checking the <code>project.lock.json</code> files into source control? If you are using <em>PackageReference</em>, it's my understanding that you can just ignore the lock file.</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/461484372018-09-26T10:57:06Z2018-09-26T10:57:07ZNuget restore and caching<div><p>project.lock.json is dead. In .NET Core today the dotnet cli outputs obj/project.assets.json, but these files cannot be tracked by GIT, or used in cache expressions in appveyor.yml.</p>
<p>I am using PackageReference in old csproj and also the new SDK csproj (also beased on PackageReference nuget model). Both use the global cache, as described above.</p>
<p>Your documentation about caching nuget packages, only describe the old packages.config Nuget model. That is why I am asking for the best way to speed up nuget restore times on the build, if not using packages.config</p></div>Morten Maxildtag:help.appveyor.com,2012-11-13:Comment/461484372018-09-27T04:11:14Z2018-09-27T04:11:14ZNuget restore and caching<div><p>So your question is what to use as a cache dependency? What about the project file that contains the <strong>PackageReference</strong> node?</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/461484372018-10-01T12:45:21Z2018-10-01T12:45:23ZNuget restore and caching<div><p>Can I cache the nuget global cache (%USERPROFILE%.nuget\packages) outside the downloaded/cloned code tree?</p></div>Morten Maxildtag:help.appveyor.com,2012-11-13:Comment/461484372018-10-01T16:10:14Z2018-10-01T16:10:14ZNuget restore and caching<div><p>I agree with your answer in <a href="https://help.appveyor.com/discussions/support/304-trial-upgrade">this thread</a> that it doesn't make sense to declare a cache dependency on the nuget global cache folder/tree. I was simply trying to answer the question I thought you were asking ("these files cannot be... used in cache expressions in appveyor.yml").</p>
<p>Sure you can cache folders outside the clone directory.</p></div>Owen McDonnell