Is there a way to open a file from solution explorer when drag and drop in code editor. VS 2010/2012 - visual-studio-2010

I really would like to be able to open files while dragging and dropping it from "Solution Explorer" to Code Editor(main) Window in visual studio.
Is there a way to do that ? Can't believe Microsoft didn't think of that !
Visual Studio instead of opening the file creates a link to that file using its path. This is useless knowing that I can do the same just copy pasting the file into the Code editor.
It is possible though to open the files directly while dragging from Windows Explorer to Code Editor Window. I want the same with "Solution Explorer" !!!

Related

How can I make Visual Studio open .linq files in LinqPad.exe rather than it's own editor

I have a VS 2017 solution that contains some .LINQ scripts. When I double click those files in the solution explorer in VS I'd love to have them open in LinqPad (the default system editor) rather than a VS text editor.
Is there a way to configure VS to do this? I tried Tools->Options->Text Editor->File Extensions but none of the options there seemed like it would open something outside VS.
I realise this is an old question and I don't have VS2017 but just in case it is applicable, VS2019 provides this functionality. If you right-click on the .linq file in Solution Explorer and choose "Open With..." you will be presented with a dialog similar to below:
LinqPad may not be in the list. If it's not then click "Add..." and navigate to where it is installed and choose the LINQPad.exe executable.
Make sure to click "Set as Default" and then click OK.
Opening the file from Solution Explorer should now open it in LinqPad rather than Visual Studio.

Visual Studio Team Explorer can't properly open a PDF file - Solution Explorer not available for "open with" setting

We have PDF (and other) files attached to TFS Work Items and in Source Control under TFS. They are not opened correctly (they show up as ASCII, basically) in Visual Studio.
The problem seems to be that until you use the 'Open With..' dialog from the Solution Explorer, VS doesn't properly associate a program with extensions like '.pdf'.
If our users had a full installation of Visual Studio, that would be an ok work-around. However, many of them only have Visual Studio 2013 with the Team Explorer component - no Solution Explorer at all.
I'm guessing that there must be some workaround for this case. Perhaps setting the proper registry value? Since VS properly remembers the association if you can tell it (through the Solution Explorer), it must be stored somewhere.
Ideas? Suggestions?
If you've got a PDF file in a project you can right-click in the solution explorer and choose "Open with..". Now you can choose which editor you want to use. If Acrobat isn't already listed you can add it and after that click the button "Set as default".
After that, your PDF's will always open with Acrobat Reader regardless if you open it from source control browser or elsewhere in the Visual Studio. But you need to configure that for all your Studios.
Reference: Answer in MSDN "Source Control Explorer Doesn't View PDF Files"
"Open with" is not available in context menu. But I found solution - well better said workaround:
You have to create external command to open this pdf file in you pdf viewer.
Go to Tools/External tools.
In command section, enter path to your PDF viewer (exe file)
In Arguments, choose "Item path". Save it under preferred name
Put this new command you created in some of existing toolbars or create new one for it. This is also little complicated, so here is how:
Hit the small arrow next to the existing toolbar, choose customize
In the new window, choose "Add command"
In the new window, your new command is hidden under the category "Tools" as command "External command 1". Add it and confirm.
Now here comes the nasty trick. This command will not work in the browser window with PDF file selected, the argument is empty :(
So you have to OPEN the pdf file into that ASCII window and THEN hit the new command. Now the file will open in you selected pdf viewer.
Hope this will help someone

How to open project folder from Visual Studio in Windows Explorer?

I'd like to have easy access to my project's folder from within Visual Studio. What do I do to open its folder in Windows Explorer?
Open the Solution Explorer >> right-click your project >> select Open Folder in Windows Explorer.
This has been tested on Visual Studio 2010. It will probably work in any other Visual Studio with a Solution Explorer.
See screenshots:
You can open some of Soluion Explorer's items (folders, projects, solutions) in File Explorer by it's right click menus subitem "Open Folder in File Explorer".
Also you can open opened documents containing folder by right click opened documents tab and "Open Containing Folder".
The easiest way...
I map a key chord to the command
Unfortunately, this only works when a project node is selected, probably because solution folders aren't actually folders and therefore it cannot be guaranteed that they actually match a folder in the file system.
Additionally to the answer opening the solution folder, there is an easy way in adding an open with for single files in the "Solution explorer". Just right click on a file, select Open With..., then Add a new entry:
As arguments you can type /select,%1 which opens the explorer with the current file selected.

Visual studio 2010 stuck

I've opened a XAML file in VS2010 that crashes Visual Studio.
The problem is that when I close VS and reload it again the XAML file automatically opens and crashes my VS again.
I don't know how to solve this loop.
Is there a way to open the solution with all files closed?
You could delete your solution's '*.suo' file. This file contain the information about the open editors. If you delete it visual Studio will not open any editor when loading the solution.
However you might lose some other customizations as well but in general there is nothing really important in this file and Visual studio will automatically create a new .suo file
I will try even a more violent method.
Move it into trash, and then bring up Visual Studio 2010.
Open another file in Visual Studio so your XAML file opening record will be washed out by the new one.
Close Visual Studio, and then restore your XAML file.
I'm pretty sure that Microsoft's file system won't track where your XAML file go and then tell Visual Studio to open it in the new location, but putting it in trash temporally is a great option.
Try temporarily move the xaml file to another location. (or rename) so VS cant find it, then you should be able to open.

File Drag & Drop ability in Visual Studio

I was wondering if any one knew of a plug-in or a way to:
I would like to be able to drag files from Solution Explorer to a Windows Explorer window and have the file copied to the location in Explorer.
Currently using VS2005
See VS Explorer - an addin which adds a file and folder browsing window to Visual Studio. It allows you to drag-drop files from Solution Explorer to external folders, vice versa and more.

Resources