Visual Studio 2012 change web browser - visual-studio

If I click control-click a hyperlink in the text editor, it opens the URL in a new Visual Studio tab. I would rather the link open outside Visual Studio in my system's default web browser (happens to be Google Chrome). How can I arrange this?
I'm talking about hyperlinks in code comments.
I am using Visual Studio 2012. I found a similar question dated 2009, however the accepted answer (a macro) doesn't work in Visual Studio 2012.

Frustratingly, this isn't possible in Visual Studio 2012 or 2013.
Bug reported to developers at http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2723548-open-links-in-an-actual-browser Please add your vote!

There is an extension Open in External Browser.
I'm using Visual Studio 2013 Professional. It works for me.
To install:
Go to "Tools" - "Extension and Updates..."
Choose "Online" - "Visual Studio Gallery" on left pane
Type in search field "open in external browser"
Click "Install"

It seems that it is not possible (except if your default browser is IE, so you would not know the difference).
As Anand wrote above, you could ctrl + right click on the link and then select open link in external window (you cannot do that on the start page, only on an opened webpage) but it still opens the window in IE no matter what your default browser is.
Even if you go to TOOLS --> Options --> Environment --> Web Browser, you will notice that it indicated that IE and the internal VS web browser are siblings.
So just copy the URL from the address bar and paste it to your default browser (it's not too much trouble in my opinion).

In VS 2012 Professional, on the toolbar next to the run debug icon, is the word 'Start' which can be expanded. When expanded you have the option to 'Open with...' and you can select the browser to open the web project up in. It does not run the debugger, it only opens the website in the selected browser. (toolbar > Start (expanded) > Open with...)

You can use the default browser switcher application if you are using Visual Studio 2010 for this kind of situation:
On your tool bar menu select "TOOLS"
Then from options choose "EXTENSION Manager"
It will open the extension manager window in the left hand side there are options choose the "Online Gallery" option
In Online Gallery search for "WoVS Default Browser Switcher"
Download it and Install it
After download restart VS
Hope this works best for you

I found a way to change the default browser for all actions in Visual Studio Express 2012 for Web. It's documented here:
By default, Visual Studio uses your default browser to test pages. To use a different browser or Page Inspector, right-click [an .aspx] page in [the] Solution Explorer and then click [...] Browse With [, which] lets you select a browser from a list, add new browsers to the list, or set one as the default browser. (The default browser setting here applies only to the Visual Studio environment and not to Windows.)
This also changes the default browser for F5'ing an MVC project, because I'm used to closing IE to stop debugging. When I let Visual Studio use my system's default browser, I first have to switch back to it from my browser to stop debugging, because closing the browser tab doesn't.
Unfortunately it still doesn't open links in comments in a browser.

I don't actually know what you mean under hyperlink, but you can easily make VS2012 working with another browser by simply.. uninstalling IE9 (Control Panel->Software->Windows components->bye bye IE9).

Well I found a workaround that is not so clean :P
Add a .html file to your project
Open the new .html file and click inside the editor.
Now Goto 'File' > 'Browse With...' from the Visual Studio Top Menu.
In the 'Browse With' Window, select the desired browser and click
the 'Set as Default' button.
Click the Browse button to set the new default selection.

This is what you have to do:
Go to the standard menu toolbar
Click on 'Add or Remove Buttons'
Tick the 'Debug Target' option

VS 2012 -->> File -->> Browse With -- >> Select Browser -->> Click on "set Default" Button -->> Now Click "Browse" Button

Go thru this setting...
Hope this will help you

Related

Change default web browser in Visual Studio

I'm trying to change the default browser to Chrome at VS Community 2015, I'm not talking about release browser, but the browser that opens when I press CTRL-Click. It opens automatically on Internet Explorer.
Click the drop down icon next to "Start" project button and choose your web browser
To change the source default editor:
Tools -> Options -> Search for "browser" -> View Source in "external editor" -> put the path to your preferred.
This is how:
Right-click your html file -> Browse with -> Click on your favorite
browser -> Set as Default.
Note that the next time you'd right-click your html file, you'd still see it says: "View in Browser (Internet Explorer)", but clicking it will actually browse with the default browser we set above.
To set "Google Chrome" as default browser in visual studio 2022
Click the drop down next to "Start" project button
Click on "Browse with"
You may find only "Internal Web Browser" & "Microsoft Edge"
Click "Add" to introduce "Chrome" as browser
Find the location of "Chrome" ex : C:\ProgramData\Microsoft\Windows\Start Menu\Programs
Select "Google Chrome"
Click "OK" in dialogue box
Select "Google Chrome" & Click "Set as Default" in dialogue
Now when you click Start button application will appear in Chrome browser.
in visual studio 2022 Click the drop down next to "Start" project button and click on "Browse with" and choose your default browser
None of this produces the result of changing the Browser used by VS to view an html file from View -> Other Windows -> Web Browser.
Options shows path to Edge but does not actually work. Still attempts to use IE resulting in url "https://learn.microsoft.com/en-us/" being loaded into VS.
OR may I am just dense and am unable to read or follow what has been stated here.
Sometimes the view in browser will not be available in context menu. Follow instructions in How to add the view in browser option back into Visual Studio 2017 context menu? and then come back to this
After spending 5 minutes searching online and not finding what I want, I dug into the Visual Studio interface and found it:
The internal web browser in Visual Studio 2019 (at least), is in View => Other Windows => Web Browser, or CTRL+ALT+R on Windows.
EDIT: According to the Microsoft Documentation, you can send the web browser command to devenv directly using nav, i.e.
devenv /command "nav https://learn.microsoft.com/"

Stop visual studio opening layout page everytime I refresh mvc web app

I'm using Visual Studio 2015.
If you create a new MVC project with all the basics it gives you (home controller, account controller, etc..), then press F5 to start it, visual studio shows the "_layout.cshtml" page in a preview window.
This gets rather frustrating if you're trying to make "on-the-fly" changes to a specific view, press F5 to refresh and see your changes, then alt-tab back to visual studio, only for it to have auto-previewed the layout page again.
How do you turn this feature off?
In Visual Studio, you should disable the checkbox for 'Enable browser link'.
I was able to reproduce on a new install. For me, the offender was "Web Essentials" extension. Try to disable and restart VS.
Also, it only happens with Edge's developer tools open. Haven't seen this with Firefox nor Chrome.
This is caused by the F12 Developer Tools where the page of the selected element in the DOM Explorer/Elements tab is automatically opened and synchronized in Visual Studio.
If you want to keep the Browser Link feature enabled, the F12 Developer Tools window open, and not lose your currently focused tab in Visual Studio, here's a work-around:
1. Right-click on the _Layout.cshtml tab in Visual Studio and select New Vertical Tab Group.
If you already have a tab group open, select Move to Next Tab Group.
2. Resize the splitter control of the tab group so that the tab group is barely visible.
3. Repeat these steps for all other files that automatically open in Visual Studio which disrupt your workflow.
I am unable to replicate your exact problem, but the following should disable the preview tab:
Type "preview" into Quick Launch
Select "Environment --> Tabs and Windows"
Disable "Allow new files to be opened in the preview tab"

Change Visual Studio 2010 Web Browser View to Firefox

Visual Studio 2010 has an integrated web browser view: Menu->View->Other Windows->Web Browser. How can I change this browser to FireFox?
Context: My goal is to have my favorite browser, as installed on the hard disk, integrated in Visual Studio. Doing so I could browse my favourite web sites the way I like, while coding. Visual Studio typically fills up my 2 screens, and using this, I could keep my browser in the foreground while not leaving visual studio.
PLEASE! Note: This question is not about the WebBrowser control usable in .NET WinForms/WPF projects, nor about testing my own code in a different browser.
Ok Here is a Manual solution to Add a new Item named Web Broweser in the Other Windows menu...
In the Tools Menu, Select External Tools...
Select Add in the opened Dialog Box...
Now Edit According to the the Fields :
Title : 'Mozilla Firefox'
Command : [Browse to the file 'firefox.exe' in the Mozilla Firefox Install folder (Default = C:\Program Files\Mozilla Firefox\firefox.exe)]
Arguements : [NULL("")]
Initial Directory : [Path to Mozilla Firefox Install Folder (Default = C:\Program Files\Mozilla Firefox\)]
Click on Apply and then on OK.
Note the Serial No. [Index] of the Entry Mozilla Firefox in the Tools Menu.
Now, In the Tools Menu, Select Customize......
Browse to Commands tab.
Select the RadioButton MenuBar and in the adjacent ComboBox, Select View | Other Windows
Select WebBrowser in the Controls ListBox and Click on Add Command...
In the Categories ListBox Choose Tools.
Now remember the Serial No. [Index] of the Entry Mozilla Firefox...
Find the Entry corresponding to External Command Index..and Select that Entry.
Click on OK.
See A new Item External Command Index has been added...
Click on Modify Selection...
Change the Name property to Web &Browser or Web Browser
Click on Close.
Check the View --> Other Windows Menu...You will find Two MenuItems with name Web Browser...
The First Item [Without the Icon] is the Newly created Firefox Shortcut...
I have found the "Always on Top" Firefox extension, which helps to keep Firefox in place and visible while fiddling with the code in Visual Studio.
Get Always On Top.
This helped me so far, even though it is not what I initially looked for.

How to switch default browser for debug asp.net in visual studio 2008 / 2010?

Since system install the default browser was opera but suddenly become IE in both 2008 and 2010 versions. Default browser in my system is opera. How I can switch make Opera default for debug again?
In Visual Studio 2010 you can right click any aspx file in Solution Exlorer and you get an option of Browse With in the Context menu. Select Browse with and you get the list of browsers in the system. There you can select the default browser.
Add an otherwise unneeded HTML page to your app via right-clicking the project and selecting Add > HTML Page, then right-click that page and select "Browse With" For more detail, see Runscope API Tools' answer here: Set Google Chrome as the Debugging Browser in Visual Studio

How to change the default browser to debug with in Visual Studio 2008?

When you hit F5, the browser windows pops up, how do you set which browser the debugger users in Visual Studio 2008?
Update 1
I have looked for the 'Browse with' option and not found it.
Visual Studio opens the default browser instead of Internet Explorer
Update 2
If you are already debugging you dont have the 'Browse with' option.
Stop debugging and then its there!
Update 3
The accepted answer below is also relevant to changing the default browser to debug with in Visual Studio 2010.
(In the Project Solution window) Right click a page (.aspx, or on a folder)
Select Browse With...
Choose your browser
Click Set as Default
Click Browse
ASP.NET projects:
Right click a webpage (.aspx, or on a folder)
Select Browse With...
Choose your browser
Click Set as Default
Click Browse
ASP.NET MVC 1 projects:
Right click Default.aspx, then follow steps above.
ASP.NET MVC 2 projects:
As there is no Default.aspx, you need to create a Web Form (right-click project > Add > New Item) and follow the steps above.
If you use ASP-NET MVC, you need to right-click on Default.ASPX which will have a Browse With menu.
To permanently make Visual Studio open a project in IE without changing the default browser you can do the following:
Project Properties -> Web -> Start Action
Start external program: C:\Program Files\Internet Explorer\iexplore.exe
Command line arguments: Enter the url of the path to your start page ie http:\localhost\myproject\default.aspx
This won't allow you to debug client side script in Visual Studio though.
If you are using MVC 2 you do not need to create another project, just add component -> webform to the project then:
* Right click the webform
* Select Browse With...
* Choose your browser
* Click Set as Default
* Delete the webform
If you use MVC, you don't have this menu (no "Browse With..." menu)
Create first a normal ASP.NET web site.
I have passed this problem in VS2012. When I can't find "Browse with.." on the right-click of the project, I found it on File Menu -> Browse with. If it doesn't appear, first you have to click on menu bar, then try open file menu again. If it still doesn't appear, you can just go to Quick Launch on the top right of menu bar then type it "Browse with".
In VS 2010 just make the browser as your default broswer in which you want to run your application and there is no need to set anything in visual studio. I did it for google chrome and its working for me. I just made google chrome as my default browser and its working fine. I am almost sure that this should work in VS 2008 also.
First click show all files. Then in the bin folder choose any xml file and then right click and by selecting 'browse with' select your desired browser.
I find that the Browse With.. menu item only appears in Visual Studio 2010 when I Run as administrator. And in that case it is available even while in debug mode.
An easier way to do this is simply by selecting the arrow next to the Start Debugging:
Then in the Drop Down goto Web Browser and select the browser you would like to debug the site with, you can also select Browse with... to set the default as explained in other answers.
ie ---> Tools ----> Internet options -----> Programe ------> Make Defualt

Resources