"dotnet" commands have permission issues
See original GitHub issueSteps to reproduce
run dotnet clean
, dotnet restore
, dotnet build
, or dotnet publish
Expected behavior
The command should complete without error
Actual behavior
Here is the error:
$ dotnet clean
Configuring…
A command is running to populate your local package cache to improve restore speed and enable offline access. This command takes up to one minute to complete and only runs once. Decompressing 100% 6734 ms System.AggregateException: One or more errors occurred. (One or more errors occurred. (Access to the path ‘/usr/local/share/dotnet/sdk/NuGetFallbackFolder/microsoft.entityframeworkcore.tools/2.1.1/microsoft.entityframeworkcore.tools.nuspec’ is denied.))
Environment data
dotnet --info
output:
.NET Core SDK (reflecting any global.json): Version: 2.1.302 Commit: 9048955601
Runtime Environment: OS Name: Mac OS X OS Version: 10.13 OS Platform: Darwin RID: osx.10.13-x64 Base Path: /usr/local/share/dotnet/sdk/2.1.302/
Host (useful for support): Version: 2.1.2 Commit: 811c3ce6c0
.NET Core SDKs installed: 2.1.4 [/usr/local/share/dotnet/sdk] 2.1.300-preview2-008533 [/usr/local/share/dotnet/sdk] 2.1.300 [/usr/local/share/dotnet/sdk] 2.1.301 [/usr/local/share/dotnet/sdk] 2.1.302 [/usr/local/share/dotnet/sdk]
.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.0-preview1-final [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.0-preview2-final [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.0-preview1-final [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.0-preview2-final [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.0-preview1-26216-03 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.0-preview2-26406-04 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:28
Top GitHub Comments
If you follow the advice and run build as root using sudo once then your obj/bin folders will be owned by root and your normal build will fail.
Please fix this properly, building should never!!! ever require admin rights, this is so very, very, very wrong.
This cache should be in a location and with permissions that non sudo users can access.
Same issue on Windows10 with .NET Core 2.2.104. I deleted the
NuGetFallbackFolder
then went to Windows Add/Remove Programs and clicked repair it. Well, it somehow is repaired. I checked theC:\Program Files\dotnet\sdk
and theNuGetFallbackFolder
is back with no error on each run now.