Package management initialization failed: Access Denied Error when opening Visual Studio 2017

It turns out that this is a bug, that hasn't yet been resolved. This error also occurs when starting Visual Studio after an update.

But there is a workaround from this thread that worked for me,

Delete the privateregistry.bin file from the following folder:

C:\users\%username%\Appdata\Local\Microsoft\VisualStudio\15.0_<version id>\

This is however a temporary fix and resets the user's preferences. That's why it worked when I started it as an administrator, since the problem is user specific.


Update

This bug is supposedly fixed in the latest versions of Visual Studio. But for the bug fix to work, the old privateregistry.bin file still needs to be deleted.


@neil-patrao answer works fine. To open the AppData folder try to type:

%AppData%

directly in the Address bar.

https://support.pointlogic.com/faq/troubleshooting/accessing-the-appdata-folder

enter image description here