question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"dotnet" commands have permission issues

See original GitHub issue

Steps 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:open
  • Created 5 years ago
  • Reactions:7
  • Comments:28

github_iconTop GitHub Comments

13reactions
trampstercommented, Oct 26, 2018

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.

4reactions
hleng1commented, Feb 16, 2019

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 the C:\Program Files\dotnet\sdk and the NuGetFallbackFolder is back with no error on each run now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

net core - Permision denied for dotnet
I recently installed dotnet 5.0 on Pop OS but whenever I try to use it it says that I don't have permission. For...
Read more >
Elevated access for dotnet commands - .NET CLI
The primary issue is permission management problems when a user transitions back and forth between root and a restricted account after issuing ...
Read more >
Dotnet commands requires sudo to run
When I use dotnet new, that can run without issue. It's when I create a new project with rider, it's giving me permission...
Read more >
5 Ways to Fix the “Access Denied” Error on Windows 11
Access denied error is a common issue on Windows systems and indicates that you don't have permission to view the file or folder....
Read more >
Cannot debug net6.0-macos Apps - Developer Community
When I hit debug, the following error is shown in the Terminal: Possible reasons for this include: * You misspelled a built-in dotnet...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found