Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to read the NuGet.Config file #19

Closed
dpatil0 opened this issue Jul 29, 2020 · 12 comments
Closed

Unable to read the NuGet.Config file #19

dpatil0 opened this issue Jul 29, 2020 · 12 comments

Comments

@dpatil0
Copy link

dpatil0 commented Jul 29, 2020

I installed Visual Studio for Mac and when creating the first app getting below issue with NuGet.

An error occurred when trying to read the NuGet.Config file. The NuGet.Config file will be treated as read-only.

Failed to read NuGet.Config due to unauthorized access. Path: '/Users/dipkishor/.config/NuGet/NuGet.Config'.

@mrward
Copy link
Member

mrward commented Jul 30, 2020

Visual Studio does not have permission to access that file. You should check the permissions on the file and its parent folder, or remove the NuGet directory so Visual Studio for Mac can re-create the file.

@ghost
Copy link

ghost commented Jul 26, 2021

I got yesterday my brand new MacBook Pro m1, and before I had a windows notebook. Earlier I started programming with C# Visual Studios, therefore I wanted to keep program in visual studios. When I opened it at first, I got the problem, that I could not access the Nuge.Config file.

After 5 hours of research, I found the solution. On my MacBook I did not have a Nuge.Config file so I had to create one on myself. First press shift + command + G and type: ~/.config . From there create a new folder called: "NuGet".
Open Link ( to png file) for proof:
Bildschirmfoto 2021-07-26 um 02 00 34

In the next Step, you have to press cmd + tab (=finder) and open "Textedit". Now you write following xml script:

Bildschirmfoto 2021-07-26 um 02 11 34

and save the file with the name: NuGet.Config.xml in a random place you wish, but you need to find it back. After creating the file, you basically copy the file and make the same steps with shift cmd g and place the file (by command + v) into the NuGet folder.
Bildschirmfoto 2021-07-26 um 02 06 33

After the delete the old NuGet.config.xml file in the random folder everything should work

If it work for you, I am happy.

@adjaythakoerdien
Copy link

This worked for me, thanks!

@BerkerSarikaya
Copy link

perfect solution thx.

@vasanthsai27
Copy link

thanks dude, its working

@nfhisey
Copy link

nfhisey commented Feb 10, 2022

Thank you this worked perfectly!

@monteroaurea
Copy link

it doesn't work for me. when you type shift + command + G (this is the terminal for you? not for me) anyway even opening the .config directory on the terminal when I try to create a new directory there I have permission denied. even try pushing it with "force" doesn't work

@nfhisey
Copy link

nfhisey commented Mar 6, 2022

@aurea94 shift + command + G will not open terminal but a file finder. You will then type in ~/.config into the file finder and it will open the config directory in finder which is shown in the first screen shot. I hope this helps

@monteroaurea
Copy link

@aurea94 shift + command + G will not open terminal but a file finder. You will then type in ~/.config into the file finder and it will open the config directory in finder which is shown in the first screen shot. I hope this helps

it did thank you

@konstanzer
Copy link

konstanzer commented Mar 18, 2022

If you create the NuGet subdirectory in .config, the NuGet.config file should generate automatically

@dougasssis
Copy link

Thanks for the solution step by step!!! =))) but in my case when I created the directory it automatically created a NuGet.Config file inside it!

@rahimdev786
Copy link

Give Full Disk Access in setting to VScode ...
that its issue is Fix..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests