CommonBuildToolset / CBT.Modules

Modules for CBT
MIT License
9 stars 5 forks source link

Package restore stops working in VS2019 #292

Open Porges opened 5 years ago

Porges commented 5 years ago

I have a project that works fine in VS2017 but in VS2019 I get the following:

MSBUILD : error : The NuGet restore data file '...\AppData\Local\Temp....tmp' does not exist. Ensure that your '...\build\Local\CBTModules\CBTModules.proj' project is using PackageReference elements and that you are using NuGet.exe v4 or later.

pwiens commented 4 years ago

If you have a global.json with a specific SDK version make sure you have that version of the dotnet core SDK installed on your machine. I just spent several hours tracking this issue down.

johnthcall commented 4 years ago

I am also seeing this on a box with only VS2019 isntalled. Interestingly it was able to restore packges for one repository but not another, even after removing all differences in build files it reproes. Let me know if I can share an internal MSFT repo.

nlyu commented 4 years ago

Does anyone find the solution?

MVoz commented 4 years ago

delete .build\Local\CBTModules\CBTModules.proj

add .build\Local\CBTModules\packages.config

example >> packages.config

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="CBT.Traversal" version="2.0.53" targetFramework="net46" />
  <package id="CBT.NuGet" version="2.2.2" targetFramework="net46" />
  <package id="CBT.DotNetFx-net46" version="1.0.0-beta01" targetFramework="net46" />
</packages>

work

https://docs.microsoft.com/en-us/nuget/reference/packages-config