- Home /
- Visual Studio /
Reported by Didier Grimaud Jul 13, 2017 at 04:02 PM Visual Studio 2017 version 15.2Fixed in: Visual Studio 2017 version 15.5 Preview 4fixed in: visual studio 2017 version 15.5Setupidewindows 6.1
I must admit that of all Visual Studios I have used since 2002 (all of them) 2017 has been the only one with which I have had a bad user experience, it seems as if it was not ready for release because it is supposed to be a productivity tool while developing but the problems are so common and often that one finds oneself spending time getting around issues or sending reports.
I have Windows 7 Ultimate x64 and run (always except for s/w installation) as a Restricted User account.
So, I ran the latest update to VS.2017 and with that come the usual problems of things not working. Prior to the update I had installed 3 Extensions:
- Bundler & Minifier
- SQLite Compact Toolbox
- Markdown Editor
After the update those three extensions suddenly appeared as DISABLED. No warning was given during the update regarding an anomaly. When I go into the Tools | Extensions menu I see the listing of currently installed extensions, and among those the three named above except those three are somehow disabled (the others aren't, they were there by default).
Now, if I click on the ENABLE button for any of those disabled extensions I get a very communicative small error dialog (modal) saying Access Denied and then some integer number, no suitable information to give the user a clue as to WHAT has been denied.
The only thing I could do without getting that meaninful error box was to click (with much trepidation!) on the UNINSTALL button which marked them for deinstallation. I was prompted to exit VS.2017 to complete uninstall.
I exited VS.2017 and a dialog popped up (as expected) indicating it was about to unistall some extensions. Then it asked for my password (I run as a RESTRICTED ACCOUNT) then it started unistalling the extension and somewhere during the progress bar on the dialog the dreaded error poped up saying it was unable to unistall due to some access denied. Luckily this other dialog DOES show a link to show you the LOG file which I did and hope to attach to this report.
So, I cannot enable an extension after the update, I cannot complete uninstall of an extension and cannot install one either!
Thank you for reporting this issue. We are actively investigating this problem with creating registry key on Windows 7 and would really appreciate your help to identify the root cause.
We have released fixes to avoid known problems with private registry file on Windows 7. To make sure we start with a clean registry file, please do the following:
- Export your current VS settings with Tools
| Import and Export Settings… because the next step will lose custom settings
and extensions
+ (If the registry is corrupted, export
settings may fail and we have to ignore this step)
- Delete VS app data:
%LocalAppData%\Microsoft\VisualStudio\15.0_[UniqueID].
+ If your account is part of the
Administrators group, launch Visual Studio as Administrator once. You can
continue to run as Standard User afterwards.
+ Otherwise, launch Visual Studio as
Standard User.
If after this you're
still experiencing Access Denied error with registry operation, please run the
attached program to collect information about the private registry hive:
- Download the attached program.txt
- Launch a "Developer Command Prompt for
VS 2017"
- Run "csc Program.txt /target:exe"
- Look for the private registry file under %LocalAppData%\Microsoft\VisualStudio\15.0_[UniqueID], the file name should be privateregistry.bin or privateregistry.user.bin
- Run Program.exe and enter the path to
%LocalAppData%\Microsoft\VisualStudio\15.0_[UniqueID]\privateregistry.bin or %LocalAppData%\Microsoft\VisualStudio\15.0_[UniqueID]\privateregistry.user.bin
- Share the generated result.txt. You can reply and attach the file.
Unfortunately the current work-around is to export settings / delete the private registry file / import settings and try again.
Thank you for reporting this issue to us. We have changed the title to better describe the problem so others can find and engage with it
All sorts of problems:
A few days ago I installed 15.3.1 and deleted the 15.0_blah folder. Today I tried to create a new project. As in the previous thread, New Project window has no templates the first time. The second time has templates, but clicking OK does nothing.
I just updated to 15.3.2, and now I get this when attempting to launch VS:
Package management initialization failed: Access Denied.
You can get more information by examining the file:
C:\Users[username]\AppData\Roaming\Microsoft\VisualStudio\15.0_e6550fb3\ActivityLog.xml
File is attached. Oddly, I now have three 15.0_blah folders. Now I have no working Visual Studio. Do I just delete the three 15.0 folders?
EDIT 1: Deleted all 15.0 folders. Still cannot launch as a standard user. Receive same error. Running as administrator works.
EDIT 2: I apparently have two Visual Studio's now. 1.10.30642.0 and 1.11.33287.817
Hi TranstecJason,
The two entries of Visual Studio in Add Remove Program is a bug and a fix will be available in a future release.
If you only have 1 installation of Visual Studio, you should have only one 15.0_e6550fb3 folder. Would you please let me know the names of the other 2 folders?
After deleting the private registry file, if you start Visual Studio as Administrators, then after that start Visual Studio as Standard User, do you still get Access Denied? That is unexpected.
For more details: we are calling RegLoadAppKey to create VS private registry file. However, on Windows 7, the default behavior is very restrictive:
- The keys are created with explicit permissions to the current user, and permissions are not inherited from parent keys to sub keys. This is fixed with Windows 8 and above.
- All the keys in the private registry hive must have the same permissions
So if VS can be launched as Administrators and there are no privateregistry.bin file, we will take advantage of Administrators privilege and copy a keys under HKCU with the correct permission set that will work for both Administrators and Standard Users. So launch once as Administrators after deleting private registry should set the registry file in a good state.
The three folders were titled:
15.0_f03a4018
15.0_e6550fb3
15.0_a24e8854
After deleting those, attempting to start VS resulted in one copy of 15.0_e6550fb3. I have not received an Access Denied message box, though that error does appear in the activity log. I assume I attempted to start VS again as a standard user after trying as an admin, but I don't recall. That never worked in the past.
I uninstalled VS 2017 and installed 15.3.2 from scratch because I have to get work done. That worked, but I don't know for how long. In the past, updating VS makes in unopenable.
@Huy Nguyen [MSFT] I received the dreaded Access Denied error today when trying to add a new class to a project. I am currently running VS2017 15.3.1. I ran the registry program against my privateregistry.user.bin and have attached the results.
Hi, came by here via link in a more matching topic - it was closed as duplicate, even so I am not sure how this could be a duplicate, because what is described down here does not seem to match, @Huy Nguyen [MSFT]
It happens on the latest Release VS2017 Enterprise (15.3.3), freshly installed, no update, while starting with an account with no administrator privileges and I receive a message box "unknown error", nothing more specific as described here. It happens on the second use with that account (user logged off once). The only thing I've done on the first run in the IDE was to change the language to english, build a project and closed it.
Deleting those private registry file as described here does not help.
Will try a repair installation next.
Hi,
For 15.3.3, a registry access denied error should result in a better error message - Package management initialization failed: Access Denied. If the error is Unknown Error, it should be a different error and would explain why deleting the private registry file did not help.
Would you please open a different feedback item and attach the activity log file (the error message should have a path to the file) when this Unknown Error happened?
Thanks!
Will do so, if the repair installation won't fix the issue.
Thanks for the clarification, that it might be possible to report this, without getting it closed as duplicate.
I've tried everything I've read and cannot run 2017 Enterrprise 15.3.5 on a Windows 7 machine with standard user privileges. I can run it with a local admin, but when I try to check in changes it apparently doesn't remember that I'm signed in to TFS with a domain account and gives me the "Login failure" error.
So we really need to be able to run this as a standard user.
This happens every time I update Visual Studio Versions. I've gotten to where I don't even want to update, because each time I have to go and delete my private registry file, and reinstall Resharper and reconfigure settings.
Thank you for your feedback! We have fixed the problem in an upcoming release. Thank you for helping us build a better Visual Studio!
The fix for this is now in our latest Visual Studio Preview release. If you'd like to try out the fix, you can access the preview build here: https://www.visualstudio.com/vs/preview
Been bitten by this annoying error, I do appreciate the help effort here (still in the process of fixing it myself). That said, I couldn't help but think "here we go, another regsitry problem"
https://blog.codinghorror.com/was-the-windows-registry-a-good-idea/
Added a solution by Erik Krane Langhaug · Aug 25, 2017 at 08:36 AM
I am running Visual Studio 2017 15.3.2 and I just encountered this issue a second time. The first time I didn't bother posting, it was when updating to 15.3 from 15.2, and I "solved" it by deleting the privateregistry.user.bin file.
And the same thing solved it this time.
I also have the same kind of user account scenario - my regular user is a domain user WITHOUT admin privileges on my workstation. For when I need it, I have a machine local administrator account that I use in order to install software and otherwise.
OS is Windows 7 Enterprise
Added a solution by Petr Petyovský · Aug 18, 2017 at 02:05 PM
Hi Huy.
Today I update VS 2017 to the your most recent build 15.3:
When I start VS like admin everything works just fine, but when I try to start VS like normal user I get this NEW message window:
Package management initialization failed: Access Denied.You can get more information by examining the file: C:\Users\xxxxxx\AppData\Roaming\Microsoft\VisualStudio\15.0_ec8ebbf4\ActivityLog.xml
It's better that Unknown error message window in the previous VS2017 builds, but it's time to solve this problem once and for all.
There is result of your C# program in the file result.txt that you want:
Exception from execution: System.IO.FileNotFoundException: Private hive does not exist.File name: '%LocalAppData%\Microsoft\VisualStudio\15.0_ec8ebbf4\privateregistry.bin|privateregistry.user.bin' at PrivateRegistryTest.Program.GetPrivateHiveFilePath() at PrivateRegistryTest.Program.Execute()
Please, can you consider to prepare some hotfix for this "VS2017's win7 update issue", otherwise VS2017 is unusable on win7. We are planned to install VS2017 to all lab PCs in our university for this semester. But without solving this issue we cannot!!
This looks like serious problem, no just some issue (delete couple of files and everything is fine).
We are simply cannot delete VS app data: "%LocalAppData%\Microsoft\VisualStudio\15.0_[UniqueID]" for all my student on all my lab computers, every time when you are release new VS 2017 build.
We need hotfix ASAP, because new semester coming, otherwise all our labs must stuck in the VS2015, and it will be shame for all your VisualStudio team, because every student will ask me why is on the lab installed old VS2015 only.
BTW: Export your current VS settings with Tools | Import and Export Settings is unachievable task, because VS2017 simply don't start.
PS: Don't hesitate to contact me for more information.
Regards,
,Hi Huy.
Some result when I update to VS2017 (15.3)
Package management initialization failed: Access Denied.You can get more information by examining the file: C:\Users\xxxxxx\AppData\Roaming\Microsoft\VisualStudio\15.0_ec8ebbf4\ActivityLog.xml
There is content of your result.txt that you want:
Exception from execution: System.IO.FileNotFoundException: Private hive does not exist. File name: '%LocalAppData%\Microsoft\VisualStudio\15.0_ec8ebbf4\privateregistry.bin|privateregistry.user.bin' at PrivateRegistryTest.Program.GetPrivateHiveFilePath() at PrivateRegistryTest.Program.Execute()
Please, can you consider prepare some hotfix for this "VS2017's win7 update issue", otherwise VS2017 is unusable on win7.
We are planned to install VS2017 to all lab PCs in our university for this semester. But without solving this issue we cannot!!
This looks like serious problem, no just some issue (delete couple of files and everything is fine).
We are cannot delete VS app data: "%LocalAppData%\Microsoft\VisualStudio\15.0_[UniqueID]" for all my student on all my lab computers, everytime when you release new VS 2017 build.
We need hotfix ASAP, because new semester comming.
BTW: Export your current VS settings with Tools | Import and Export Settings is unachievable task, because VS2017 simply don't start.
Regards,
Peter
Hi, would you please try deleting VS local app data once and starting VS with the right permissions on Windows 7?
- Delete VS app data: %LocalAppData%\Microsoft\VisualStudio\15.0_[UniqueID].
+ If your account is part of the Administrators group, launch Visual Studio as Administrator once. You can continue to run as Standard User afterwards.
+ Otherwise, launch Visual Studio as Standard User.
In 15.3, a change was made to separate the private registry file for users using VS in mixed Administrator / Standard User privileges. That change may require deleting the VS app data folder once. But subsequent updates should not cause the problems.
We're actively investigating the new registry corruption issue on Windows 7.
Added a solution by Javidan Guliyev · Aug 23, 2017 at 12:53 PM
Hi. After updating to latest build, I cannot open VS2017 with admin privileges even. How to downgrade to previous build?
Hi Javidan, please try to delete the corrupted private registry file
- Go to %LocalAppData%\Microsoft\VisualStudio\15.0_[UniqueID] - [UniqueID] is different per installation
- Delete privateregistry.bin or privateregistry.user.bin file
The registry changes were ported to VS 2017 15.2 and 15.3, so downgrading to previous build will not change the registry behavior on Windows 7. We are investigating the new corruption issue on Windows 7 at the moment.
Added a solution by Roland Steiner · Aug 25, 2017 at 10:17 AM
Same issue here, with an Access Denied dialog on startup, and corresponding entry in ActivityLog.xml:
<entry> <record>29</record> <time>2017/08/25 09:48:50.306</time> <type>Error</type> <source>VisualStudio</source> <description>Failed to process PkgDef file</description> <hr>80070005 - E_ACCESSDENIED</hr> <errorinfo></errorinfo> <path>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\Extensions\ClassDesigner_REG_27921.3643236F_FC70_11D3_A536_0090278A1BB8.pkgdef</path> </entry>
This issue persists for quite a while now (previously the "Unknown Error" issue on startup), and forces me to delete privateregistry.bin every single time, losing my settings.
(Win 7, non-Admin account.)
On a related note: Why is it that the keyboard shortcuts are not affected, while editor settings are?
Added a solution by Michel Capdevila · Sep 30, 2017 at 07:26 PM
I have VS 15.3.5 and even deleting privateregistry.user.bin & privateregistry.bin is working until next vs start, losing all the settings and previously enabled extensions is not suitable for a professional product. furthermore I cannot launch VS with Administrative privilege even by deleting private registry bin, as a consequence none of vsix extension that require admin privileges can be installed, SSDT in particular. Very disappointing from Microsoft.
The following event "An I/O operation initiated by the Registry failed unrecoverably.The Registry could not flush hive (file): '\??\C:\Users\L008078\AppData\Local\Microsoft\VisualStudio\15.0_72c42306\privateregistry.user.bin'." fires every time VS is Starting.
Added a solution by Radames Cruz Moreno · Oct 03, 2017 at 10:34 PM
To all people having this problem, we would appreciate if you can please try the following workaround:
After this you should be able to start Visual Studio and use it normally, and we expect that you will not see the "Access Denied" error again. Please do let us know if this workaround does not work for you, as well as if you still experience the problem after using the workaround.
As Huy has mentioned before, we are actively investigating the root cause for this issue.
I get the unknown error when trying to launch after trying the workaround.exe. Here are the last 2 entries in ActivityLog.xml:
<entry> <record>6</record> <time>2017/10/03 22:46:44.499</time> <type>Error</type> <source>VisualStudio</source> <description>Failed to initialize Registry Root Hive</description> <hr>800703f1</hr> </entry> <entry> <record>7</record> <time>2017/10/03 22:46:44.499</time> <type>Warning</type> <source>VisualStudio</source> <description>Unable to initialize cache</description> <hr>800703f1</hr></entry>
Hi Kevin,
Could you please attach the full activitylog.xml file?
Thank you.
Hi again Kevin,
The error code that you posted would indicate that the registry is corrupt. Since the program creates a new file on disk, I'm thinking it might be one of the supporting files for the old file: Windows creates a couple of hidden files to support app hives (privateregistry.bin.LOG1, privateregistry.bin.LOG2 for example).
In order to rule this out, can you please try:
Thank you.
The workaround ran without any errors. So far I'm able to use VS again without "access denied" etc messages. What is the expected outcome? Do I have to run this workout every time the bug is back (it wouldn't be better than deleting the reg file then) or do you hope that the bug is gone now?
Hi,
The expectation is that the problem will not appear again. The workaround is meant to create a new privateregistry.bin with the correct set of permissions that we hope will prevent this issue from happening.
We continue to investigate the root cause for this failure. If the workaround works as we expect it will be very helpful in our investigation, please do let us know if you find any issues after applying it.
Thank you.
Hi Radames,
just a thumps up from me: the workaround still works for me. This is the longest time I ever had without any errors from VS.
I tried the workaround with all possible combinations (deleting private registry file, 15_0[DUID] , etc., but nothing is working. The only way for me to start VS is deleting all privateregistry.user.bin & privateregistry.bin but every time vs is starting the event log says: "An I/O operation initiated by the Registry failed unrecoverably.The Registry could not flush hive (file): '\??\C:\Users\xxxxx\AppData\Local\Microsoft\VisualStudio\15.0_72c42306\privateregistry.user.bin'."
Hi Michel,
Could you please tell us what is the output you see when you run the workaround? It would be specially helpful if you:
1. Delete the %LocalAppData%\Microsoft\VisualStudio\15.0_[UniqueID] directory
2. Create an empty %LocalAppData%\Microsoft\VisualStudio\15.0_[UniqueID] directory
3. Run the workaround pointing to the empty directory
Thank you,
-Radames
Hi Radames, no luck, always the same
vs-workaround.png The workaround flooded me with cmd windows and wouldn't stop creating them until i managed to kill the process. Needless to say still can't run my Visual Studio as regular account.
Hi Slav,
Did you get prompted to enter an administrator user / password when you ran the workaround?
Thank you,
-Radames
Hi Radames,
I was not prompted to enter credentials. The program was just creating new console windows in an infinite loop.
Added a solution by Przemyslaw Seneczko · Sep 13, 2017 at 07:07 PM
Same here, but also in 15.3.4. Windows 7, devenv run from standard user account.
Happened for the first time ever, after upgrading from 15.3.3 (or maybe 15.3.2, not sure) Package management initialization failed: Access Denied.
Fixed after deleting local app data\15.0_unique
<entry> <record>29</record> <time>2017/09/13 18:43:07.127</time> <type>Error</type> <source>VisualStudio</source> <description>Failed to process PkgDef file</description> <hr>80070005 - E_ACCESSDENIED</hr> <errorinfo></errorinfo> <path>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\Extensions\DSLTextTemplatingRegistry_x86.pkgdef</path> </entry><entry> <record>30</record> <time>2017/09/13 18:43:07.127</time> <type>Error</type> <source>VisualStudio</source> <description>PkgDef loading aborted</description> <hr>80070005 - E_ACCESSDENIED</hr> <errorinfo></errorinfo> </entry> <entry> <record>41</record> <time>2017/09/13 18:43:07.129</time> <type>Error</type> <source>VisualStudio</source> <description>Failed to process PkgDef file</description> <hr>80070005 - E_ACCESSDENIED</hr> <errorinfo></errorinfo> <path>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\Extensions\DSLTextTemplatingRegistry_x86.pkgdef</path> </entry>
<entry> <record>42</record> <time>2017/09/13 18:43:07.129</time> <type>Error</type> <source>VisualStudio</source> <description>PkgDef loading aborted</description> <hr>80070005 - E_ACCESSDENIED</hr> <errorinfo></errorinfo> </entry>
<entry> <record>43</record> <time>2017/09/13 18:43:07.129</time> <type>Error</type> <source>VisualStudio</source> <description>Error or timeout while initializing non-volatile pkgdef cache</description> <hr>80070005 - E_ACCESSDENIED</hr> <errorinfo></errorinfo> </entry>
I wonder why this helped as it does not help after trying it on our machine. I am still getting Access Denied errors for every PkgDef file. I also elevated the account, to start it as administrator, did not helped.
Added a solution by hilmar frank · Sep 20, 2017 at 04:44 PM
Hello,
would love to provide a solution, but can only report that things did not improve with 15.3.5 i just updated to.
Administrative users don't have an issue, all others do.
I wonder whether a solution is under investigation, since it is not sustainable to start from scratch each time updates are applied. Refraining from updating the application will render it obsolete sooner or later.
Currently this keeps me from getting really "invested" into VisualStudio, as i can't tell whether this will work for me on the long...
Please help!
Thanks in advance.
Hi,
We are still investigating a fix for this problem. So far we noticed that when the private registry file is created as a Standard User, certain keys may be created with a different permission set (only different on a 'session' user). However, this seems to only corrupt the registry file randomly. We think we have a repro now and will engage with Windows team to investigate the issue. Our latest attempt to force the permission set to be the same as the root key failed because of Windows 7 restriction as well. We are looking at other work-around and will update this report when we have any new information.
Added a solution by Ronald Mar · Sep 23, 2017 at 11:07 PM
I've discovered a temporary workaround. It's a little onerous, but it does work. Basically, I temporarily changed my user profile to admin and rebooted. Then, re-ran vs_Community.exe and selected repair; when done, reboot as directed. Then, still temporarily as admin, ran VS2017 to initialize the settings. Every seemed to work. Then, I changed my account type back to standard and rebooted. VS2017 runs normally again.
Edit: I should add that I'm using 15.3.5.
Added a solution by Ronald Mar · Oct 12, 2017 at 10:14 PM
I just updated to 15.4.0 and the problem seems to be fixed.
Hi Thomas,
Have you tried the workaround posted here? If you do, please let us know if it works for you.
Thank you,
-Radames
Hi Radames,
I tried the postet workaround, but I still have the problem.
Here is the result.txt from your program.exe. I execute your program on both privateregistry.bin and privateregistry.user.bin folders. Both with the same result.
Hi Thomas,
Thank you for attaching the file.
Just to make sure, are the steps below the ones you followed? Note that the workaround is called "workaround.exe".
The program will prompt for elevation credentials, and after you provide them will create a new empty "privateregistry.bin" file in the directory that was provided as a parameter.
Thank you,
-Radames
Hi Radames,
yes, this is the sequence which I followed.
BR,
Thomas
VS Not responding when creating new ASP.Net webforms project or loading existing solution.
2
Solution
VS installation error Return code 5100
0
Solution
When I click on the highlight file in the Solution Explorer in Visual Studio, nothing happens
1
Solution
login Window do nothing
1
Solution
Opening a file - windows claims it is in use.
0
Solution
Visual Studio crashes unexpectedly
0
Solution
VS2017 Setup operation failed
1
Solution
Extensions not installing after download
0
Solution
Why I can't install Profiling tools for Visual Studio 2017 on Windows 7 Unltimate x64
1
Solution