Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 352
user3246883 Avatar asked Jan 29 '14 01:01

user3246883


Video Answer


2 Answers

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"

like image 123
Brett Avatar answered Sep 20 '22 23:09

Brett


"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.

  1. Go to Tools/External tools.
  2. In command section, enter path to your PDF viewer (exe file)
  3. In Arguments, choose "Item path". Save it under preferred name
  4. 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:
  5. Hit the small arrow next to the existing toolbar, choose customize
  6. In the new window, choose "Add command"
  7. 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

like image 41
Grador Avatar answered Sep 22 '22 23:09

Grador