2.2.105.toolpath.sentinel directory missing ?
See original GitHub issue@DweeberlyLoom commented on Wed Mar 20 2019
Problem encountered on https://dotnet.microsoft.com/learn/web/aspnet-microservice-tutorial/create Operating System: windows
PS C:\Users\dweeb> dotnet new webapi -o myMicroservice --no-https
System.UnauthorizedAccessException: Access to the path 'C:\Users\dweeb\.dotnet\2.2.105.toolpath.sentinel' is denied.
at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
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.Extensions.EnvironmentAbstractions.FileWrapper.CreateEmptyFile(String path)
at Microsoft.DotNet.Configurer.FileSentinel.Create()
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)
PS C:\Users\dweeb> dir 'C:\Users\dweeb\.dotnet\2.2.105*'
Directory: C:\Users\dweeb\.dotnet
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 3/20/2019 9:01 PM 5 2.2.105_IsDockerContainer.dotnetUserLevelCache
-a---- 3/20/2019 9:01 PM 64 2.2.105_MachineId.dotnetUserLevelCache
It would appear that the SDK doesn’t install what you think it installs … ?
@karelz commented on Sat Mar 30 2019
@DweeberlyLoom how did you install the SDK? Is it maybe some weird machine setup? Can you try it on clean VM/another machine to see if it is one machine problem or general problem? Thanks!
@karelz commented on Sat Mar 30 2019
cc @dagood
@dagood commented on Mon Apr 01 2019
Moving to the dotnet/cli repo because Microsoft.DotNet.Configurer.FileSentinel
lives there, and I think the people with the most context will see it there.
So far, this does look like an unusual permissions issue: System.UnauthorizedAccessException: Access to the path 'C:\Users\dweeb\.dotnet\2.2.105.toolpath.sentinel' is denied.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
This appears to have fixed the problem:
In Windows, the equivalent would be taking ownership of the folder by right clicking on it and going to
Properties/Security/Advanced
and clickingchange
next to the owner.I installed on ubuntu 18.04 LTC (WSL 2) using the script here (https://github.com/dotnet/core/blob/master/release-notes/5.0/preview/5.0.0-preview.7-install-instructions.md). I recieve the same error
System.UnauthorizedAccessException: Access to the path '/home/alexanderhiggins/.dotnet/5.0.100-preview.7.20366.6.toolpath.sentinel' is denied.
runningdotnet build
or the same command as OP. Not a linux guru but ls -alt shows the following. The directory in windows exporer is readonly to my user and empty. I assume it is because sudo created the folder with root as the owner. I will try changing the owner or setting a different DOTNET_CLI_HOME environment variable to see if it fixes the issue.drwxr-xr-x 2 root root 4096 Aug 5 21:11 .dotnet