dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.67k stars 1.06k forks source link

"dotnet" commands have permission issues #9649

Open mrlife opened 6 years ago

mrlife commented 6 years ago

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]

mrlife commented 6 years ago

Looks like deleting the "NuGetFallbackFolder" fixed the issue. Any idea what the problem was?

wli3 commented 6 years ago

how did you install SDK via tar.gz or apt-get? install via tar.gz might have this problem when you did not run it with sudo when the location is a sudo location.

mrlife commented 6 years ago

I used the macOS "Installer" from: https://www.microsoft.com/net/download/dotnet-core/2.1. I think it had a .pkg extension.

cuevaskoch commented 6 years ago

I'm facing the same error on ubuntu updating to apt-git. I renamed the folder to NuGetfallbackFolder.bak, and the SDK still complains about it but allows me to continue

wli3 commented 6 years ago

@jrkoch @mrlife it should be some permission mismatch. The end goal is expand nugetfallbackfolder with correct permission. To fix it, you could run any dotnet command other than help/info with sudo. However, i am still investigating why this issue happens in the first place. 1. fallbackfolder should expand during installer with sudo. Did it get interrupted? 2. when it find no permission to expand, SDK should try to expand it under ~/.dotnet folder

wli3 commented 6 years ago

Similar issue here, but on Windows

https://github.com/dotnet/cli/issues/9842

cuevaskoch commented 6 years ago

It didn’t get interrupted in my case. I am facing it on two Ubuntu installs, both running 18.04 upgraded from 17.10. And both had the dotnet 2.1 preview installed and have been kept up to date via the apt repositories. On Wed, Aug 15, 2018 at 11:14 AM William Li notifications@github.com wrote:

Similar issue here, but on Windows

dotnet/cli#9842 https://github.com/dotnet/cli/issues/9842

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dotnet/cli/issues/9807#issuecomment-413286418, or mute the thread https://github.com/notifications/unsubscribe-auth/AEbwK5pzvIpl3J_ysOYqfIIkqY6ScQ9Kks5uRGT9gaJpZM4V2Q2j .

Tadimsky commented 6 years ago

Responding to questions on other issue @livarcocc:

How is dotnet being installed? Msi? Zip?

Msi install

When prompted for admin permissions, are you allowing it?

In the installer? Yes.

The fallback folder should be expanded by the msi during installation. Something is either causing it not to happen or it is happening and we are failing to write the sentinel file that tells us it did happen.

Do you happen to have a DOTNET_SKIP_FIRST_RUN_EXPERIENCE environment variable set to true?

No, it is not set.

jtsom commented 6 years ago

Also happening on a brand new MacOS system, first time install of latest SDK (2.1.400). Any dotnet command results in:

-> % dotnet restore

Permission denied to modify the '/usr/local/share/dotnet/sdk/NuGetFallbackFolder' folder.

Here are some options to fix this error:
----------------------------------------
1. Re-run this command with elevated access.
2. Disabled the first run experience by setting the environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE to true.
3. Copy the .NET Core SDK to a non-protected location and use it from there.

The sdk was installed from the MacOS package installer on a fresh system.

I tried using a 'sudo dotnet' command but now I'm getting multiple exceptions:

-> % sudo dotnet tool

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% 5130 ms
System.AggregateException: One or more errors occurred. (One or more errors occurred. (Access to the path '/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.io.filesystem/4.0.1/ref/netstandard1.3/System.IO.FileSystem.dll' is denied.)) (One or more errors occurred. (Access to the path '/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.reflection.extensions/4.0.1/lib/MonoAndroid10/_._' is denied.)) (One or more errors occurred. (Access to the path '/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.reflection.emit.lightweight/4.3.0/system.reflection.emit.lightweight.nuspec' is denied.)) (One or more errors occurred. (Access to the path '/tmp/724440ba-4e14-46a4-b8ce-3f77e1adfd35' is denied.)) (One or more errors occurred. (Access to the path '/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.diagnostics.process/4.3.0/runtimes/win/lib/netstandard1.4/System.Diagnostics.Process.dll' is denied.)) (One or more errors occurred. (Access to the path '/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.runtime.serialization.primitives/4.3.0/ref/netstandard1.0/ru/System.Runtime.Serialization.Primitives.xml' is denied.)) (One or more errors occurred. (Access to the path '/tmp/724440ba-4e14-46a4-b8ce-3f77e1adfd35' is denied.)) (One or more errors occurred. (Access to the path '/tmp/724440ba-4e14-46a4-b8ce-3f77e1adfd35' is denied.)) (One or more errors occurred. (Access to the path '/tmp/724440ba-4e14-46a4-b8ce-3f77e1adfd35' is denied.)) (One or more errors occurred. (Access to the path '/tmp/724440ba-4e14-46a4-b8ce-3f77e1adfd35' is denied.)) (One or more errors occurred. (Access to the path '/tmp/724440ba-4e14-46a4-b8ce-3f77e1adfd35' is denied.)) (One or more errors occurred. (Access to the path '/tmp/724440ba-4e14-46a4-b8ce-3f77e1adfd35' is denied.)) (Access to the path '/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.io.filesystem/4.0.1/ref/netstandard1.3/System.IO.FileSystem.dll' is denied.) (Access to the path '/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.reflection.extensions/4.0.1/lib/MonoAndroid10/_._' is denied.) (Access to the path '/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.reflection.emit.lightweight/4.3.0/system.reflection.emit.lightweight.nuspec' is denied.) (Access to the path '/tmp/724440ba-4e14-46a4-b8ce-3f77e1adfd35' is denied.) (Access to the path '/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.diagnostics.process/4.3.0/runtimes/win/lib/netstandard1.4/System.Diagnostics.Process.dll' is denied.) (Access to the path '/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.runtime.serialization.primitives/4.3.0/ref/netstandard1.0/ru/System.Runtime.Serialization.Primitives.xml' is denied.) (Access to the path '/tmp/724440ba-4e14-46a4-b8ce-3f77e1adfd35' is denied.) (Access to the path '/tmp/724440ba-4e14-46a4-b8ce-3f77e1adfd35' is denied.) (Access to the path '/tmp/724440ba-4e14-46a4-b8ce-3f77e1adfd35' is denied.) (Access to the path '/tmp/724440ba-4e14-46a4-b8ce-3f77e1adfd35' is denied.) (Access to the path '/tmp/724440ba-4e14-46a4-b8ce-3f77e1adfd35' is denied.) (Access to the path '/tmp/724440ba-4e14-46a4-b8ce-3f77e1adfd35' is denied.) ---> System.UnauthorizedAccessException: Access to the path '/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.io.filesystem/4.0.1/ref/netstandard1.3/System.IO.FileSystem.dll' is denied. ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
   at System.IO.File.Create(String path)
   at Microsoft.DotNet.Archive.IndexedArchive.CopyOperation.Execute()
   at Microsoft.DotNet.Archive.IndexedArchive.ExtractOperation.DoOperation()
   at Microsoft.DotNet.Archive.IndexedArchive.<>c__DisplayClass19_1.<Extract>b__0(ExtractOperation extractOperation)
   at System.Linq.Parallel.ForAllOperator`1.ForAllEnumerator`1.MoveNext(TInput& currentElement, Int32& currentKey)
   at System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork()
   at System.Linq.Parallel.SpoolingTaskBase.Work()
   at System.Linq.Parallel.QueryTask.BaseWork(Object unused)
   at System.Linq.Parallel.QueryTask.<>c.<.cctor>b__10_0(Object o)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
   --- End of inner exception stack trace ---
   at System.Linq.Parallel.QueryTaskGroupState.QueryEnd(Boolean userInitiatedDispose)
   at System.Linq.Parallel.SpoolingTask.SpoolForAll[TInputOutput,TIgnoreKey](QueryTaskGroupState groupState, PartitionedStream`2 partitions, TaskScheduler taskScheduler)
   at System.Linq.Parallel.MergeExecutor`1.Execute()
   at System.Linq.Parallel.MergeExecutor`1.Execute[TKey](PartitionedStream`2 partitions, Boolean ignoreOutput, ParallelMergeOptions options, TaskScheduler taskScheduler, Boolean isOrdered, CancellationState cancellationState, Int32 queryId)
   at System.Linq.Parallel.PartitionedStreamMerger`1.Receive[TKey](PartitionedStream`2 partitionedStream)
   at System.Linq.Parallel.ForAllOperator`1.WrapPartitionedStream[TKey](PartitionedStream`2 inputStream, IPartitionedStreamRecipient`1 recipient, Boolean preferStriping, QuerySettings settings)
   at System.Linq.Parallel.UnaryQueryOperator`2.UnaryQueryOperatorResults.ChildResultsRecipient.Receive[TKey](PartitionedStream`2 inputStream)
   at System.Linq.Parallel.ListQueryResults`1.GivePartitionedStream(IPartitionedStreamRecipient`1 recipient)
   at System.Linq.Parallel.UnaryQueryOperator`2.UnaryQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient`1 recipient)
   at System.Linq.Parallel.QueryOperator`1.GetOpenedEnumerator(Nullable`1 mergeOptions, Boolean suppressOrder, Boolean forEffect, QuerySettings querySettings)
   at System.Linq.Parallel.ForAllOperator`1.RunSynchronously()
   at System.Linq.ParallelEnumerable.ForAll[TSource](ParallelQuery`1 source, Action`1 action)
   at Microsoft.DotNet.Archive.IndexedArchive.Extract(String compressedArchivePath, String outputDirectory, IProgress`1 progress)
   at Microsoft.DotNet.Configurer.NuGetPackagesArchiver.ExtractArchive(String archiveDestination)
   at Microsoft.DotNet.Configurer.NuGetCachePrimer.PrimeCache()
   at Microsoft.DotNet.Configurer.DotnetFirstTimeUseConfigurer.Configure()
   at Microsoft.DotNet.Cli.Program.ConfigureDotNetForFirstTimeUse(INuGetCacheSentinel nugetCacheSentinel, IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel, IAspNetCertificateSentinel aspNetCertificateSentinel, IFileSentinel toolPathSentinel, Boolean hasSuperUserAccess, DotnetFirstRunConfiguration dotnetFirstRunConfiguration, IEnvironmentProvider environmentProvider)
   at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient)
   at Microsoft.DotNet.Cli.Program.Main(String[] args)
---> (Inner Exception #0) System.UnauthorizedAccessException: Access to the path '/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.io.filesystem/4.0.1/ref/netstandard1.3/System.IO.FileSystem.dll' is denied. ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
   at System.IO.File.Create(String path)
   at Microsoft.DotNet.Archive.IndexedArchive.CopyOperation.Execute()
   at Microsoft.DotNet.Archive.IndexedArchive.ExtractOperation.DoOperation()
   at Microsoft.DotNet.Archive.IndexedArchive.<>c__DisplayClass19_1.<Extract>b__0(ExtractOperation extractOperation)
   at System.Linq.Parallel.ForAllOperator`1.ForAllEnumerator`1.MoveNext(TInput& currentElement, Int32& currentKey)
   at System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork()
   at System.Linq.Parallel.SpoolingTaskBase.Work()
   at System.Linq.Parallel.QueryTask.BaseWork(Object unused)
   at System.Linq.Parallel.QueryTask.<>c.<.cctor>b__10_0(Object o)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)<---

---> (Inner Exception dotnet/sdk#4283) System.UnauthorizedAccessException: Access to the path '/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.reflection.extensions/4.0.1/lib/MonoAndroid10/_._' is denied. ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
   at System.IO.File.Create(String path)
   at Microsoft.DotNet.Archive.IndexedArchive.CopyOperation.Execute()
   at Microsoft.DotNet.Archive.IndexedArchive.ExtractOperation.DoOperation()
   at Microsoft.DotNet.Archive.IndexedArchive.<>c__DisplayClass19_1.<Extract>b__0(ExtractOperation extractOperation)
   at System.Linq.Parallel.ForAllOperator`1.ForAllEnumerator`1.MoveNext(TInput& currentElement, Int32& currentKey)
   at System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork()
   at System.Linq.Parallel.SpoolingTaskBase.Work()
   at System.Linq.Parallel.QueryTask.BaseWork(Object unused)
   at System.Linq.Parallel.QueryTask.<>c.<.cctor>b__10_0(Object o)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)<---

---> (Inner Exception dotnet/sdk#4284) System.UnauthorizedAccessException: Access to the path '/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.reflection.emit.lightweight/4.3.0/system.reflection.emit.lightweight.nuspec' is denied. ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
   at System.IO.File.Create(String path)
   at Microsoft.DotNet.Archive.IndexedArchive.CopyOperation.Execute()
   at Microsoft.DotNet.Archive.IndexedArchive.ExtractOperation.DoOperation()
   at Microsoft.DotNet.Archive.IndexedArchive.<>c__DisplayClass19_1.<Extract>b__0(ExtractOperation extractOperation)
   at System.Linq.Parallel.ForAllOperator`1.ForAllEnumerator`1.MoveNext(TInput& currentElement, Int32& currentKey)
   at System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork()
   at System.Linq.Parallel.SpoolingTaskBase.Work()
   at System.Linq.Parallel.QueryTask.BaseWork(Object unused)
   at System.Linq.Parallel.QueryTask.<>c.<.cctor>b__10_0(Object o)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)<---

---> (Inner Exception dotnet/sdk#4285) System.UnauthorizedAccessException: Access to the path '/tmp/724440ba-4e14-46a4-b8ce-3f77e1adfd35' is denied. ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at System.IO.File.Open(String path, FileMode mode, FileAccess access, FileShare share)
   at Microsoft.DotNet.Archive.ThreadLocalZipArchive.<>c__DisplayClass2_0.<.ctor>b__0()
   at System.Threading.ThreadLocal`1.GetValueSlow()
   at Microsoft.DotNet.Archive.IndexedArchive.ExtractSource.CopyToStream(Stream destinationStream)
   at Microsoft.DotNet.Archive.IndexedArchive.CopyOperation.Execute()
   at Microsoft.DotNet.Archive.IndexedArchive.ExtractOperation.DoOperation()
   at Microsoft.DotNet.Archive.IndexedArchive.<>c__DisplayClass19_1.<Extract>b__0(ExtractOperation extractOperation)
   at System.Linq.Parallel.ForAllOperator`1.ForAllEnumerator`1.MoveNext(TInput& currentElement, Int32& currentKey)
   at System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork()
   at System.Linq.Parallel.SpoolingTaskBase.Work()
   at System.Linq.Parallel.QueryTask.BaseWork(Object unused)
   at System.Linq.Parallel.QueryTask.<>c.<.cctor>b__10_0(Object o)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)<---

---> (Inner Exception dotnet/sdk#4286) System.UnauthorizedAccessException: Access to the path '/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.diagnostics.process/4.3.0/runtimes/win/lib/netstandard1.4/System.Diagnostics.Process.dll' is denied. ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
   at System.IO.File.Create(String path)
   at Microsoft.DotNet.Archive.IndexedArchive.CopyOperation.Execute()
   at Microsoft.DotNet.Archive.IndexedArchive.ExtractOperation.DoOperation()
   at Microsoft.DotNet.Archive.IndexedArchive.<>c__DisplayClass19_1.<Extract>b__0(ExtractOperation extractOperation)
   at System.Linq.Parallel.ForAllOperator`1.ForAllEnumerator`1.MoveNext(TInput& currentElement, Int32& currentKey)
   at System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork()
   at System.Linq.Parallel.SpoolingTaskBase.Work()
   at System.Linq.Parallel.QueryTask.BaseWork(Object unused)
   at System.Linq.Parallel.QueryTask.RunTaskSynchronously(Object o)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)<---

---> (Inner Exception dotnet/cli#5) System.UnauthorizedAccessException: Access to the path '/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.runtime.serialization.primitives/4.3.0/ref/netstandard1.0/ru/System.Runtime.Serialization.Primitives.xml' is denied. ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
   at System.IO.File.Create(String path)
   at Microsoft.DotNet.Archive.IndexedArchive.CopyOperation.Execute()
   at Microsoft.DotNet.Archive.IndexedArchive.ExtractOperation.DoOperation()
   at Microsoft.DotNet.Archive.IndexedArchive.<>c__DisplayClass19_1.<Extract>b__0(ExtractOperation extractOperation)
   at System.Linq.Parallel.ForAllOperator`1.ForAllEnumerator`1.MoveNext(TInput& currentElement, Int32& currentKey)
   at System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork()
   at System.Linq.Parallel.SpoolingTaskBase.Work()
   at System.Linq.Parallel.QueryTask.BaseWork(Object unused)
   at System.Linq.Parallel.QueryTask.<>c.<.cctor>b__10_0(Object o)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)<---

---> (Inner Exception dotnet/cli#6) System.UnauthorizedAccessException: Access to the path '/tmp/724440ba-4e14-46a4-b8ce-3f77e1adfd35' is denied. ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at System.IO.File.Open(String path, FileMode mode, FileAccess access, FileShare share)
   at Microsoft.DotNet.Archive.ThreadLocalZipArchive.<>c__DisplayClass2_0.<.ctor>b__0()
   at System.Threading.ThreadLocal`1.GetValueSlow()
   at Microsoft.DotNet.Archive.IndexedArchive.ExtractSource.CopyToStream(Stream destinationStream)
   at Microsoft.DotNet.Archive.IndexedArchive.CopyOperation.Execute()
   at Microsoft.DotNet.Archive.IndexedArchive.ExtractOperation.DoOperation()
   at Microsoft.DotNet.Archive.IndexedArchive.<>c__DisplayClass19_1.<Extract>b__0(ExtractOperation extractOperation)
   at System.Linq.Parallel.ForAllOperator`1.ForAllEnumerator`1.MoveNext(TInput& currentElement, Int32& currentKey)
   at System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork()
   at System.Linq.Parallel.SpoolingTaskBase.Work()
   at System.Linq.Parallel.QueryTask.BaseWork(Object unused)
   at System.Linq.Parallel.QueryTask.<>c.<.cctor>b__10_0(Object o)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)<---

---> (Inner Exception dotnet/cli#7) System.UnauthorizedAccessException: Access to the path '/tmp/724440ba-4e14-46a4-b8ce-3f77e1adfd35' is denied. ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at System.IO.File.Open(String path, FileMode mode, FileAccess access, FileShare share)
   at Microsoft.DotNet.Archive.ThreadLocalZipArchive.<>c__DisplayClass2_0.<.ctor>b__0()
   at System.Threading.ThreadLocal`1.GetValueSlow()
   at Microsoft.DotNet.Archive.IndexedArchive.ExtractSource.CopyToStream(Stream destinationStream)
   at Microsoft.DotNet.Archive.IndexedArchive.CopyOperation.Execute()
   at Microsoft.DotNet.Archive.IndexedArchive.ExtractOperation.DoOperation()
   at Microsoft.DotNet.Archive.IndexedArchive.<>c__DisplayClass19_1.<Extract>b__0(ExtractOperation extractOperation)
   at System.Linq.Parallel.ForAllOperator`1.ForAllEnumerator`1.MoveNext(TInput& currentElement, Int32& currentKey)
   at System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork()
   at System.Linq.Parallel.SpoolingTaskBase.Work()
   at System.Linq.Parallel.QueryTask.BaseWork(Object unused)
   at System.Linq.Parallel.QueryTask.<>c.<.cctor>b__10_0(Object o)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)<---

---> (Inner Exception dotnet/cli#8) System.UnauthorizedAccessException: Access to the path '/tmp/724440ba-4e14-46a4-b8ce-3f77e1adfd35' is denied. ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at System.IO.File.Open(String path, FileMode mode, FileAccess access, FileShare share)
   at Microsoft.DotNet.Archive.ThreadLocalZipArchive.<>c__DisplayClass2_0.<.ctor>b__0()
   at System.Threading.ThreadLocal`1.GetValueSlow()
   at Microsoft.DotNet.Archive.IndexedArchive.ExtractSource.CopyToStream(Stream destinationStream)
   at Microsoft.DotNet.Archive.IndexedArchive.CopyOperation.Execute()
   at Microsoft.DotNet.Archive.IndexedArchive.ExtractOperation.DoOperation()
   at Microsoft.DotNet.Archive.IndexedArchive.<>c__DisplayClass19_1.<Extract>b__0(ExtractOperation extractOperation)
   at System.Linq.Parallel.ForAllOperator`1.ForAllEnumerator`1.MoveNext(TInput& currentElement, Int32& currentKey)
   at System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork()
   at System.Linq.Parallel.SpoolingTaskBase.Work()
   at System.Linq.Parallel.QueryTask.BaseWork(Object unused)
   at System.Linq.Parallel.QueryTask.<>c.<.cctor>b__10_0(Object o)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)<---

---> (Inner Exception dotnet/sdk#4287) System.UnauthorizedAccessException: Access to the path '/tmp/724440ba-4e14-46a4-b8ce-3f77e1adfd35' is denied. ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at System.IO.File.Open(String path, FileMode mode, FileAccess access, FileShare share)
   at Microsoft.DotNet.Archive.ThreadLocalZipArchive.<>c__DisplayClass2_0.<.ctor>b__0()
   at System.Threading.ThreadLocal`1.GetValueSlow()
   at Microsoft.DotNet.Archive.IndexedArchive.ExtractSource.CopyToStream(Stream destinationStream)
   at Microsoft.DotNet.Archive.IndexedArchive.CopyOperation.Execute()
   at Microsoft.DotNet.Archive.IndexedArchive.ExtractOperation.DoOperation()
   at Microsoft.DotNet.Archive.IndexedArchive.<>c__DisplayClass19_1.<Extract>b__0(ExtractOperation extractOperation)
   at System.Linq.Parallel.ForAllOperator`1.ForAllEnumerator`1.MoveNext(TInput& currentElement, Int32& currentKey)
   at System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork()
   at System.Linq.Parallel.SpoolingTaskBase.Work()
   at System.Linq.Parallel.QueryTask.BaseWork(Object unused)
   at System.Linq.Parallel.QueryTask.<>c.<.cctor>b__10_0(Object o)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)<---

---> (Inner Exception dotnet/sdk#4288) System.UnauthorizedAccessException: Access to the path '/tmp/724440ba-4e14-46a4-b8ce-3f77e1adfd35' is denied. ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at System.IO.File.Open(String path, FileMode mode, FileAccess access, FileShare share)
   at Microsoft.DotNet.Archive.ThreadLocalZipArchive.<>c__DisplayClass2_0.<.ctor>b__0()
   at System.Threading.ThreadLocal`1.GetValueSlow()
   at Microsoft.DotNet.Archive.IndexedArchive.ExtractSource.CopyToStream(Stream destinationStream)
   at Microsoft.DotNet.Archive.IndexedArchive.CopyOperation.Execute()
   at Microsoft.DotNet.Archive.IndexedArchive.ExtractOperation.DoOperation()
   at Microsoft.DotNet.Archive.IndexedArchive.<>c__DisplayClass19_1.<Extract>b__0(ExtractOperation extractOperation)
   at System.Linq.Parallel.ForAllOperator`1.ForAllEnumerator`1.MoveNext(TInput& currentElement, Int32& currentKey)
   at System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork()
   at System.Linq.Parallel.SpoolingTaskBase.Work()
   at System.Linq.Parallel.QueryTask.BaseWork(Object unused)
   at System.Linq.Parallel.QueryTask.<>c.<.cctor>b__10_0(Object o)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)<---

---> (Inner Exception dotnet/sdk#4289) System.UnauthorizedAccessException: Access to the path '/tmp/724440ba-4e14-46a4-b8ce-3f77e1adfd35' is denied. ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at System.IO.File.Open(String path, FileMode mode, FileAccess access, FileShare share)
   at Microsoft.DotNet.Archive.ThreadLocalZipArchive.<>c__DisplayClass2_0.<.ctor>b__0()
   at System.Threading.ThreadLocal`1.GetValueSlow()
   at Microsoft.DotNet.Archive.IndexedArchive.ExtractSource.CopyToStream(Stream destinationStream)
   at Microsoft.DotNet.Archive.IndexedArchive.ZipOperation.Execute()
   at Microsoft.DotNet.Archive.IndexedArchive.ExtractOperation.DoOperation()
   at Microsoft.DotNet.Archive.IndexedArchive.<>c__DisplayClass19_1.<Extract>b__0(ExtractOperation extractOperation)
   at System.Linq.Parallel.ForAllOperator`1.ForAllEnumerator`1.MoveNext(TInput& currentElement, Int32& currentKey)
   at System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork()
   at System.Linq.Parallel.SpoolingTaskBase.Work()
   at System.Linq.Parallel.QueryTask.BaseWork(Object unused)
   at System.Linq.Parallel.QueryTask.<>c.<.cctor>b__10_0(Object o)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)<---
jtsom commented 6 years ago

Well, turns out it looks like it was the install of Trend Micro Antivirus. I had the IT department uninstall it and the sudo tool command went through without a problem....

trampster commented 5 years ago

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.

tmasabari commented 5 years ago

I faced the similar issue on Windows 7 laptop where the dotnet commands were running successfully. This problem appeared suddenly. When I tried to run the same command in Administrator mode as described, packages cache got updated. So package cache management is the culprit?

Configuring...

A command is running to populate your local package cache to improve restore spe ed and enable offline access. This command takes up to one minute to complete an d only runs once. Decompressing 100% 40101 ms Expanding 100% 135531 ms

The dotnet.exe is executing well once the cache population is completed.

bitcoinbrisbane commented 5 years ago

I received this error because I set my Environment to production (to try fix another issue). The below fixed it for me

On Linux export ASPNETCORE_ENVIRONMENT=Development

MacOS and Windows see https://docs.microsoft.com/en-us/aspnet/core/fundamentals/environments?view=aspnetcore-2.1

Imartinn commented 5 years ago

I'm facing the same error on ubuntu updating to apt-git. I renamed the folder to NuGetfallbackFolder.bak, and the SDK still complains about it but allows me to continue

This worked for me, the problem started after the update to dotnet core 2.2. I'm using Windows 10.

TrevorFradsham commented 5 years ago

I am too facing the same error. I have a newly configured ubuntu machine and after running:

~/code/c#/repos$ dotnet new console --output mvvm

and

~/code/c#/repos/mvvm$ dotnet restore

I get the following output error in both cases:

Permission denied to modify the '/usr/share/dotnet/sdk/NuGetFallbackFolder' folder. Here are some options to fix this error: ---------------------------------------- 1. Re-run this command with elevated access. 2. Disabled the first run experience by setting the environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE to true. 3. Copy the .NET Core SDK to a non-protected location and use it from there.

Here is my kernel version: Linux 4.15.0-42-generic dotnet/sdk#4317-Ubuntu SMP Thu Nov 15 19:32:57 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Here is the dotnet info:

~$ dotnet --info .NET Core SDK (reflecting any global.json): Version: 2.2.101 Commit: 236713b0b7

Runtime Environment: OS Name: ubuntu OS Version: 18.04 OS Platform: Linux RID: ubuntu.18.04-x64 Base Path: /usr/share/dotnet/sdk/2.2.101/

Host (useful for support): Version: 2.2.0 Commit: 1249f08fed

.NET Core SDKs installed: 2.2.101 [/usr/share/dotnet/sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.2.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.2.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.2.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

TrevorFradsham commented 5 years ago

I have been able to resolve my error by deleting the folder

/usr/share/dotnet/sdk/NuGetFallbackFolder

then completely uninstalling all dotnet components

dotnet-host dotnet-hostfxr-2.2 dotnet-runtime-2.2 dotnet-runtime-deps-2.2 dotnet-sdk-2.2

and reinstalling the dotnet-sdk2.2. Not really the way to fix the problem but it worked for me.

k-rus commented 5 years ago

I experience this issue on Linux Ubuntu 18.04.1 LTS. dotnet was installed with apt-get according to the instructions. When I run dotnet run in a project, I get the following error, but it doesn't prevent for the application to start:

:~/Projects/ScApp$ dotnet run

Permission denied to modify the '/usr/share/dotnet/sdk/NuGetFallbackFolder' folder.

Here are some options to fix this error:
----------------------------------------
1. Re-run this command with elevated access.
2. Disabled the first run experience by setting the environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE to true.
3. Copy the .NET Core SDK to a non-protected location and use it from there.
hleng1 commented 5 years ago

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.

roa-nyx commented 5 years ago

Same issue for me, this happened to me right after I added the "Desktop environment for C++" workload to my VS2017 install. Maybe that messed with some permissions for that folder or it's ownership?

In my case I uninstalled all Core entries in Add/Remove, and then reinstalled from scratch, works fine now.

tonyranieri commented 5 years ago

I started having this issue on Win10 after updating to .NET core 2.2.203 from a previous 2.2 install (I'm not sure which but I think it was 2.2.104). I installed the SDK via the installer found on http://dot.net

To make the error go away I ran powershell as admin, killed all .NET process, VS Code, etc, and ran a dotnet restore in the source directory. After it completed I was able to go back into VS Code and non-admin powershell terminals and build without error.

asmaa3107 commented 5 years ago

I started having this issue on Win10 after updating to .NET core 2.2.203 from a previous 2.2 install (I'm not sure which but I think it was 2.2.104). I installed the SDK via the installer found on http://dot.net

To make the error go away I ran powershell as admin, killed all .NET process, VS Code, etc, and ran a dotnet restore in the source directory. After it completed I was able to go back into VS Code and non-admin powershell terminals and build without error.

How to Kill all .net Process?

roa-nyx commented 5 years ago

@asmaa3107 on windows: ctrl+shift+esc, Details tab, find all processes named dotnet.exe. Hit End Task. There is also a command, although I don't know it off-hand, and this should be good enough for you.

If there are no dotnet.exe processes you don't need to kill anything.

vasilevp commented 5 years ago

On Windows, changing permissions on C:\Program Files\dotnet\sdk\NuGetFallbackFolder worked for me (Properties -> Security -> Edit... -> Full Control for Administrators and Users).

christoph-feb22 commented 5 years ago

I've updated to the latest sdk 2.2.301 and the error still occurs. For me the error only occures while trying to run a dotnet tool. I'm using macOS 10.14.5

HusseinElGanzory commented 5 years ago

i give all permissions to a folder /usr/share/dotnet/sdk/NuGetFallbackFolder sudo chmod -R 777 /usr/share/dotnet/sdk/NuGetFallbackFolder then build project i worked very well

trampster commented 5 years ago

@HusseinElGanzory Thanks, however for the developers, it is extremely wrong that this is necessary, 777 is a extreme nuke it from orbit approach with very serious security implications.

There is no world in which it is OK for a build to by default require root access, ever, this should be a very high priority fix, the fact this issue still persists after 11 months is very concerning.

jnsatterfield commented 5 years ago

I have a similar issue under Ubuntu 18.10

This is not a fix, but is only being provided as additional information for anyone who might find it useful.

When issuing a build command on the command line, I would receive two messages:

  1. The message regarding access to modify NuGetFallbackFolder being denied
  2. A Build Failed message with the following info:

    ~/.nuget/packages/microsoft.aspnetcore.razor.design/2.2.0/build/netstandard2.0/Microsoft.AspNetCore.Razor.Design.CodeGeneration.targets(71,5): error MSB3374: The last access/last write time on file "obj/Debug/netcoreapp2.2/{PROJECT}.TagHelpers.input.cache" cannot be set. Access to the path '/shared/backups/projects/Development/Web/{PROJECT}/dotnet/obj/Debug/netcoreapp2.2/{PROJECT}.TagHelpers.input.cache' is denied. [/shared/backups/projects/Development/Web/{PROJECT}/dotnet/{PROJECT}.csproj]

The path located at /shared/backups/projects/* is located on an NTFS drive, usable by both Windows and Linux (dual-boot). As a point of curiosity, I copied the project to my home path, and took ownership of all of the files. All of my errors and warnings disappeared without changing anything else.

When investigating, I noticed that ownership for the obj/Debug/* files were all set to root:plugdev, with permissions of 770. Despite my account being a member of the plugdev group, write permissions to these files was being denied on the NTFS share.

HTH

razvanmuntea commented 4 years ago

browser error: HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure

log file error Permission denied to modify the 'D:\Program Files (x86)\dotnet\sdk\NuGetFallbackFolder' folder.

I was trying to deploy an ASP.net core app to Azure and had this error in my stdoutLogfile. setting the deploy Target Runtime to win-x86 worked for me