dotnet paket fails after installing VS 2019 16.8
See original GitHub issueDescription
I’ve been using paket as a .net tool for a netcoreapp3.1 project. However, after installing the latest update to VS2019 (16.8) yesterday, I’m getting a errors when I try to run dotnet paket restore
. It was working prior to this.
Repro steps
Please provide the steps required to reproduce the problem
-
dotnet tool restore
-
dotnet paket restore
Expected behavior
Packages should be restored without errors.
Actual behavior
Getting these errors:
Cannot use file stream for [C:\Users\dan.jensen.nuget\packages\paket\5.251.0\tools\netcoreapp2.1\any\paket.deps.json]: No such file or directory A fatal error was encountered. The library ‘hostpolicy.dll’ required to execute the application was not found in 'C:\Users\dan.jensen.nuget\packages\paket\5.251.0\tools\netcoreapp2.1\any'. Failed to run as a self-contained app.
- The application was run as a self-contained app because ‘C:\Users\dan.jensen.nuget\packages\paket\5.251.0\tools\netcoreapp2.1\any\paket.runtimeconfig.json’ was not found.
- If this should be a framework-dependent app, add the ‘C:\Users\dan.jensen.nuget\packages\paket\5.251.0\tools\netcoreapp2.1\any\paket.runtimeconfig.json’ file and specify the appropriate framework.
Known workarounds
The old school paket.exe approach does work for me.
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (6 by maintainers)
Top GitHub Comments
@forki I found the problem, and it was my fault. When I run the dotnet commands directly, they work at first. But if I run our build script, one of the things it was doing was: dotnet paket clear-cache. Since we switched to using paket as a dotnet tool recently, that was actually the cause of the problem because it would essentially delete itself. Or at least all of its supporting files. And after that it wouldn’t work right. I can change my script to not do that anymore.
One question though: since using paket as a dotnet tool is the recommended approach now, is there a way to use the clear-cache option anymore? Or is that basically deprecated now?
Thanks for your help!
It was caused by something I was doing, not paket.