aspnet / dnvm

OBSOLETE - see readme
Other
174 stars 61 forks source link

Windows 10 unable to dnvm upgrade from beta7 - Permission Denied #505

Closed jwdavidson closed 6 years ago

jwdavidson commented 8 years ago

dnvm upgrade command fails

C:\WINDOWS\system32>dnvm upgrade Determining latest version Test-Path : Access is denied At C:\Users\John.dnx\bin\dnvm.ps1:1441 char:12

New-Item : Access is denied At C:\Users\John.dnx\bin\dnvm.ps1:1445 char:9

Downloading dnx-clr-win-x86.1.0.0-rc1-update1 from https://www.nuget.org/api/v2 Unable to download package: An exception occurred during a WebClient request. At C:\Users\John.dnx\bin\dnvm.ps1:694 char:13

Inspection of the temp directory shows that there are no read permissions for any user and that it is impossible to reset the permissions so that a user can access the directory.

muratg commented 8 years ago

DNVM/DNX/DNU are being retired in favor of dotnet CLI in RC2. Feel free to workaround this by manually downloading and replacing the PS1.

jwdavidson commented 8 years ago

@muratg Where should I download the new PS1 from? The one in this repository seems to still use .dnx directory. I assume it creates a new file structure other than .dnx, as mine is totally borked.

muratg commented 8 years ago

You can do it through the dnvm repo (if you follow the script, basically you can do it manually)

Or, if you're content with RC1 dnvm, the simplest method would be deleting everything and reinstalling it from https://get.asp.net/

jwdavidson commented 8 years ago

@muratg You are not understanding the issue. It is impossible to delete everything. Neither the takeown or icacls commands will let me remove the directory. The temp directory that exists in .dnx is causing everything to be blocked. The ps1 file that is currently in place will not execute as the temp directory must not exist at the start or it must be deletable.

The only way to fix this looks like mounting the drive in a linux box and then doing the delete.

It was a really bad idea to put the dnx files in the the home directory of the user if this kind of error can occur. If the directory is not removed then I will have to abandon that user on my computer, which is a huge fail.

muratg commented 8 years ago

This is the first time I hear a folder being "impossible to delete" due to dnvm. I assume you already checked locking issues (i.e. a running process keeping a file open in that folder) I also assume you tried taking ownership through the UI. You can possibly delete the folder with System privileges, but that's slightly risky.

Also, from your initial report, why does the folder name C:\Users\John.dnx\ and not C:\Users\John\.dnx\? Is that a typo?

jwdavidson commented 8 years ago

@muratg There was a backslash missing from the path a you recognized. The UI would not let me get access using any privileges. I deleted it by mounting in a Linux machine. After that dnvm started working correctly again. It must have been some anomalous state for the directory.