Fix "Unable to Find Package" NuGet Error in Visual Studio C#
Visual Studio is an open-source code editor with powerful toolings such as Intellisense, Code Completion, auto-indentation, bracket matching, code highlighting, bracket highlighting, font style, family selection, code refactoring, and many more.
There are also numerous plugins and extensions available that allow us to make numerous changes to settings, making our lives easier.
Sometimes you mess up with those settings and don't know which ones are causing the problem, in this case, you like to reset every setting of visual studio code to default.
There are several methods for restoring the default settings in Visual Studio Code. Let us go over each of them.
The steps are as follows:
1 Open Visual Studio
2 Click on the Gear icon β located at the bottom left corner next to your Account
3 Click on Settings.Β
4 Click on the file sheet icon π located at the top right corner. This will open settings.json
5 Now, remove everything from there and replace it with {} bracket.
This will reset every user setting made in the visual studio Code.
Using the Open Settings (JSON) command we can reset VS Code settings. The steps are as follows:
1 Open Visual Studio Code
2 Press Ctrl+ Shift + P (Mac or Windows) or just press F1 and type "Open Settings( JSON)" and click on it.
3 This will open settings.jsonΒ
4 Now, remove everything from there and replace it with {} bracket.
In this method, you do not have to open Visual Studio Code. We instead use file explorer.
1 Open Run and type: %userprofile%\AppData\Roaming\Code\UserΒ for Windows OS and press Enter
For Mac : $HOME/Library/Application Support/Code/User
For Linux: $HOME/.config/Code/User.
2 Find the settings.json file and open it with notepad or any code editor
3 Remove everything and put {} bracket.
This will reset every user setting made in visual studio code.
If clearing the settings does not resolve your issue, you may also need to uninstall the extensions.
4 Press + R and type : %USERPROFILE%\.vscode\extensions and press Enter
For Mac:~/.vscode/extensions
For Linux: ~/.vscode/extensions
5 Delete everything from there.Β
This will delete all your extension installed.Β
To remove all your settings and extension without any prompt message use the below command one by one :
rm -r ~/.vscode-oss/
rm -r ~/.config/Code - OSS/
Here, we are removing the vscode-oss folder and config/Code - OSS folder. And '~' denotes /home/username in Unix System
Sometimes you know exactly what you're doing and which 'key' in the settings is causing the issue. If you know that, you can easily make that key-value the default.
Suppose my settings 'fontSize' is creating the problem and I want to set it to default.
1 Press Ctrl +, and this will open Setting Search Bar then type key there. In my case, I will type fontsize and it will filter out other nonmatching keys and will only show you the font size setting.
2 Now to edit this fontsize setting then click on Gear Icon located at the size and click on Reset Setting and this will reset the particular field only.
This applies only to this key. If you want to apply for another key then follow similar steps.
FAQ:
Ans: Simple option is to use the settings.json file.
How to reset Magnification in Visual Studio Code?
Ans: Reseting Magnification in Visual Studio Code is very simple. Just follow the below steps:Β
You can create settings.json for each project by creating a new file and inside that create a setting object and assign key-value setting there as shown below.