Visual Studio 2010 "Open With..." is missing? - visual-studio-2010

I'm trying to change Visual Studio to open my code instead of designer by default. This question tells me to right click on a file and go to "Open With..."
However, when I try to right click on a file in my solution explorer I have no "Open With..." option. I'm not sure if this is caused by an extension (I have the CodeRush Xpress, VSCommands, Productivity Power tools, and VCS tools for SVN, Git, and Hg), or what, but I would like to be able to configure what my files open with.
Where do I need to go to either get the menu option back or change these settings?

The context menu can be modified. If you haven't heavily customized your command bars and menus then a full reset is wise. Tools + Import/Export, "Reset all settings" radio button.
Or fix the context menu. Tools + Customize, Commands tab, click the "Context menu" radio button. Select the "Project and Solution Context Menu | Item" option from the combobox. Click the Add Command button.

This MSDN link might help you:
How to: Change or Add a Default Editor
It's not the most intuitive method, but from the link:
On the File menu in Visual Studio, choose Open and then select File.
In the Open File dialog box, select a file of the type you want to change.
Still in the Open File dialog box, click the down arrow next to the Open button, and then select Open With.
In the Open With dialog box, choose an editor from the Select a program to open list.
Click the Set as Default button and then click the Open button to open the file.

Related

Visual Studio Solution Explorer, selected file changes when I click into Main Coding View [duplicate]

In my Visual Studio 2012 Solution Explorer, when I single click a filename it opens it. This was different from Visual Studio 2010 (required a double click). Is there a way to make double-click the 'view file' command?
This is called the Preview Tab feature. To change that behavior, go to:
Tools -> Options -> Environment -> Tabs and Windows
Then look for the "Preview Tab" section, and uncheck the options therein:
Option 1: Using icon in Solution Explorer
You can enable or disable the feature in Solution Explorer using the "Preview Selected Items" button.
The icon is a Tab aligned to the right.
Option 2: Using the Options window
You can enable or disable the feature by going into Tools > Options and then Environment > Tabs and Windows.
The Single-click opens files in the preview tab text mentioned in rubber boots' answer is missing in VS 2015. Mysteriously, a search for "single click" still brings up the Environment > Tabs and Windows option.
So for VS2015 and VS2017, either click the button in Vinicius's answer, or uncheck the Preview selected files in Solution Explorer box shown in the screenshot below.
In Visual studio 12/13, easiest way is to type "single click" in quick search and than select Tabs and Windows.
And in Tabs and Windows dialogue ,uncheck "Preview selected files in solutions explorer"
Shortcut Ctrl+Alt+Home.
If you press that in a document that was just opened, it will be opened permanently.
Item -> right click -> Open With -> Source Code (Text) Editor -> press Set as Default button
It's no longer there in VS2019. You enable/disable it through "preview selected Items" in Solution Explorer.

Visual Studio 2012 "Show All Files" button missing

In my solution I have three projects: Console application, class library, and a website project.
The Show All Files button is visible on the console and class library project, but soon as I click on the website project the button disappears.
I am running Visual Studio 2012.
I just got the same problem "Solution Explorer toolbar missing" eg. "Show all files". Here's what I did:
Right click your "Solution".
Select "New Solution Explorer View". This will pop-up a new "Solution Explorer" window with toolbars in it.
Close you original "Solution Explorer" window.
Click on folder which must contain target file and Solution explorer properties will be changed. There you can find Refresh button and Show all files button.
Check this post:
Improved Solution Explorer in Visual Studio 2012 to Improve Productivity
"Show All Files" is not shown in a Web Site Project because it's not needed and all files are already shown in the Solution Explorer. I think that this behavior is the same for older versions of VS
In Solution Explorer, click on a project, and then the 'Show All Files' button will appear.
If you are in a WebSite project all files are shown by default. If there are some missing (added during debugging etc), just hit the refresh button on the top of the solution explorer and they should appear.
None of the above answers worked for me. If this is the case for you try right-clicking on any file in your project, then choosing "Show all files". The "Show all files" icon should now appear on this and all subsequent Solution Explorer windows.
YMMV, be kind. :-)
The "Show All Files" auto hides.
Click on the folder that has the hidden file, the button should show up.
By clicking on the project (the folder under the solution) the solution explore checks if all sub folders has hidden file, this will prompt the button to be revealed.
If you want to get Show all file menu just hide the solution explorer and open it fom view=>Other Windows=>Solution Explorer and clik it it will show all files menu
if you click on solution name in "solution explorer" maybe you will can't see "Show all files" button. because maybe added F# or website project in solution.
if you want see "Show all files" button, you must click on project name which is C# or native C++ or C++.net.
try to open any file use ctrl+alt+a . once a file will open "show all" button will appear automatically.

How to stop Visual Studio from opening a file on single click?

In my Visual Studio 2012 Solution Explorer, when I single click a filename it opens it. This was different from Visual Studio 2010 (required a double click). Is there a way to make double-click the 'view file' command?
This is called the Preview Tab feature. To change that behavior, go to:
Tools -> Options -> Environment -> Tabs and Windows
Then look for the "Preview Tab" section, and uncheck the options therein:
Option 1: Using icon in Solution Explorer
You can enable or disable the feature in Solution Explorer using the "Preview Selected Items" button.
The icon is a Tab aligned to the right.
Option 2: Using the Options window
You can enable or disable the feature by going into Tools > Options and then Environment > Tabs and Windows.
The Single-click opens files in the preview tab text mentioned in rubber boots' answer is missing in VS 2015. Mysteriously, a search for "single click" still brings up the Environment > Tabs and Windows option.
So for VS2015 and VS2017, either click the button in Vinicius's answer, or uncheck the Preview selected files in Solution Explorer box shown in the screenshot below.
In Visual studio 12/13, easiest way is to type "single click" in quick search and than select Tabs and Windows.
And in Tabs and Windows dialogue ,uncheck "Preview selected files in solutions explorer"
Shortcut Ctrl+Alt+Home.
If you press that in a document that was just opened, it will be opened permanently.
Item -> right click -> Open With -> Source Code (Text) Editor -> press Set as Default button
It's no longer there in VS2019. You enable/disable it through "preview selected Items" in Solution Explorer.

Visual Studio - Is there simple way to add 'Close Solution" to r-click in Solution Explorer

I can't seem to break the habit of always right clicking on the solution to try and close a solution. Then I always remember and take my mouse the great distance across the screen to find it in the File menu.
I don't use it enough to remember a keystroke.
I use VS2008, VS2010 and occasionally VS2012
I'd prefer not to build an addin just for this small task.
In Visual Studio 2010 you can:
Right click on the Tool menu and click "Customize..".
Click the "Commands" tab.
Click the "Context menu" option.
Select the "Project and Solution Context Menus | Solution".
Click the "Add Command..." button.
Select "File" in the "Categories" list box.
Select "Close Solution" in the "Commands" list box.
Move up/down as desired.
Click "Close" and enjoy.
I don't have VS 2008 or 2012 handy, but the steps should be similar.
Edit: For VS2008
Right click on the Tool menu and click "Customize..".
Click the "Toolbars" tab.
Check the "Context menu" option. (the Context Menus tool bar will appear)
Select Command Tab in the current dialog.
Select "File" in the "Categories" list box.
Select "Close Solution" in the "Commands" list box.
Drag the Command to the "Select the "Project and Solution Context Menus" in the context Menus toolbar. You can drop it anywhere on the menu or in a sub menu - ie "Project and Solution Context Menus | Solution"
Click "Close" and enjoy.
VISUAL STUDIO 2019
Here is the way to do this with COMBINATION KEYS, that it is so better than add it to toolbar or context menu :)
Go to Tools menu
Go to Options
Press Ctrl+E and search Keyboard // OR go to
Environment>Keyboard
In right side type CLOSE in search bar(below of "Show
commands containing" I mean)
Go down and select the "File.CloseSolution" from the results
Click on the box "Press shortcuts keys:" and specify your
combination's key
Be aware that Visual Studio has a lot of default combination keys and do not use any regular shortcut.( I used Ctrl+F4)
Check the "Use new shortcut in:" and select your place that want to
use this shortcut (I suggest to use GLOBAL)
Click Assign > OK > Have Fun
You can close the solution by simply clicking File->Close Solution in Visual Studio 2017

How to recover control deleted from ToolBox In Visual Studio?

I've deleted a tool from ToolBox by accident. How I can get it back if possible?
The standard way is to select the tab in the toolbox and select "Choose Items", this opens a window that allows you a list of controls to add, or you can browse to find the control in it's assembly if it is not there.
You can also restore the toolbox to the original configuration with a Right Click on the Toolbox and select "Reset Toolbox" (WARNING: This will give you the VS defaults. If you loaded any control libraries, you will lose them and have to reload them with their installer or "Choose Items").
Just right click any tool and select reset toolbox....you will get the deleted tool.
Disclaimer: This is based on memory.
Right click on Toolbox, you should get properties/configure or Add Control option. Select that option and a dialog box will appear listing all types (.net, COM) of control. Select the control that has gone missing and it should be back to your toolbox.
If reset toolbox does not help please try the following:
- right click on the blank toolbox area and select the option "Add/remove Items";
- click on the browse button;
- if 'Windows Forms' controls are missing navigate to:
C:\WINDOWS\Microsoft.NET\Framework\vx.xxxx\System.Windows.Forms.dll
- if 'Web' controls are missing navigate to:
C:\WINDOWS\Microsoft.NET\Framework\vx.xxxx\System.Web.dll
- and press OK.
The controls should then appear on the relevant tabs.
For Visual Studios or other visual stuff, to reset the toolbox and other tools click windows then go to reset windows layout.

Resources