Clearing cache corrupts paket tool
See original GitHub issueDescription
Running dotnet paket clear-cache
command causes paket to become corrupt and unusable
Repro steps
- Install paket locally in an application using dotnet core
dotnet new tool-manifest
,dotnet tool install paket
,dotnet tool restore
- Run
dotnet paket clear-cache
:
C:\repos\MyApp> dotnet paket clear-cache
Paket version 5.247.4
- C:\Users\vitor\.nuget\packages
Performance:
- Runtime: 1 second
Paket failed with
-> UnauthorizedAccessException: Access to the path 'C:\Users\vitor\.nuget\packages\paket\5.247.4\tools\netcoreapp2.1\any\Argu.dll' is denied.
- Paket carshes and becomes corrupt:
C:\repos\MyApp>dotnet paket --version
A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\Users\vitor\.nuget\packages\paket\5.247.4\tools\netcoreapp2.1\any\'.
Failed to run as a self-contained app. If this should be a framework-dependent app, add the C:\Users\vitor\.nuget\packages\paket\5.247.4\tools\netcoreapp2.1\any\paket.runtimeconfig.json file specifying the appropriate framework.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
paket clear-cache
Clear the global and optionally local NuGet and cache directories. ... If you add the --verbose flag Paket will run in verbose mode...
Read more >How can I clear the NuGet package cache using ...
First, download the NuGet command line tool from here. Next, open a command prompt and cd to the directory to which nuget.exe was...
Read more >How to clear app cache on Android & why you should
Clearing cache may not be advisable for all purposes, but sometimes it's just what your phone needs to work properly again.
Read more >How to Clear Cache on Android (And When You Should)
In most cases, clearing the cache from a few problematic apps can resolve storage or performance issues. Follow these steps to clear cached...
Read more >How to Clean YUM Cache {4 Options Explained}
Learn how to clean YUM cache and prevent metadata errors. Read this guide for different ways to clear YUM cache and free up...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’d say the
clear-cache
shouldOpinions, @forki ?
The current
cache-clear
just tries to delete every file in the common nuget cache folders recursively. I can use some better erorr handling though 😉 (And a warning cannot hurt as well)