Rider (2021.3.2) looking for Nuget.config in the wrong place?


I switched which user I am running Rider as, but on the same computer.

If I look at the NuGet window under Sources, it says c:\users\newuser\appdata\roaming\nuget\nuget.config

If I look under Folders, I see many mentions of c:\users\newuser\<subfolder>

I see no mention of c:\users\olduser\<subfolder> anywhere.

But whenever a NuGet restore occurs, the log is filled with many occurrences of the following exception:

NuGet.Configuration.NuGetConfigurationException: Failed to read NuGet.Config due to unauthorized access. Path: 'C:\Users\olduser\AppData\Roaming\NuGet\NuGet.Config'. ---> System.UnauthorizedAccessException: Access to the path 'C:\Users\olduser\AppData' is denied.

Where is Rider getting this path to olduser? It cannot access another user's user folder, and I don't know why it would try to.

Comment actions Permalink

Hello Dave,

Could you please enable Trace scenario for NuGet via Help | Diagnostic Tools | Choose Trace Scenarios, reproduce the issue, collect the logs after via Help | Collect Logs and attach the resulting bundle with a new issue on our tracker. Thank you in advance!

Comment actions Permalink

I ran into this again. I tried creating a new solution and project and the new solution didn't have the problem. I deleted the problematic solution's .idea folder and .dotsetitngs.user file and the problem went away. (I had a look for the problem path but didn't find it in any of the files, but maybe I missed it.)


Please sign in to leave a comment.