-
Notifications
You must be signed in to change notification settings - Fork 269
Error in Visual Studio if Path contains directory you do not have permission to view #14192
Description
NuGet Product Used
Visual Studio Package Management UI
Product Version
Visual Studio Version 17.13.0
Worked before?
Version 17.12 (I think) - Probably prior to NuGet/NuGet.Client#6177
Impact
It bothers me, a fix would be nice.
Repro Steps & Context
Since upgrading Visual Studio, every time we open a project, the following error appears:

The path in question is for some tooling our IT team has installed - it adds itself to the machine wide path, but users don't have permissions on the file system to access the directory.
I believe this regression was introduced by NuGet/NuGet.Client#6177, specifically with https://github.com/NuGet/NuGet.Client/blob/555651e288f0276f2808dde7a40276a84b9adf3e/src/NuGet.Core/NuGet.Protocol/Plugins/PluginDiscoverer.cs#L243-L263 - it is possible for a user to have permission to see that a directory exists, but then not have permissions to view it - the loop likely needs some kind of continue on access denied logic.
Repro Steps
- Create a directory which you can see, but do not have permission to access
- Add this to the path
- Open Visual Studio
For reference, below are the permissions for the directory in question

Verbose Logs
Severity Code Description Project File Line Suppression State Details
Error The plugin credential providers could not be loaded.
Access to the path 'REDACTED' is denied.