How do you disable built in web browser [duplicate] - visual-studio-2010

This question already has answers here:
How do I open links in Visual Studio in my web browser and not in Visual Studio?
(6 answers)
Closed 9 years ago.
is there a way to disable the Visual Studio web browser? I just want it to launch my actual browser when I ctrl-click a hyperlink in a comment.
I see there's a Web Browser option in in the Environment tab found onTools --> Options...But there doesn't seem to be way to disable it entirely.
Extensions are welcome if there is no native way to do this.
So when I click on a comment (example here shows a comment in an XML file)
I want it to launch Chrome, not this built-in IE tab in Visual Studio
Edit I marked this question as a duplicate of another question. Someone provided this macro:
Sub OpenURLInChrome()
' Select to end of line
DTE.ActiveDocument.Selection.EndOfLine(True)
Dim selection As TextSelection = DTE.ActiveDocument.Selection
' Find URL within selection
Dim match = System.Text.RegularExpressions.Regex.Match(selection.Text, ".*(http\S+)")
Dim url As String = ""
If (match.Success) Then
If match.Groups.Count = 2 Then
url = match.Groups(1).Value
End If
End If
' Remove selection
selection.SwapAnchor()
selection.Collapse()
If (url = String.Empty) Then
MsgBox("No URL found")
End If
'launch chrome with url
System.Diagnostics.Process.Start(url)
End Sub
Then bind it to a key and you use it by setting the cursor at the start of the URL, then pressing your hotkey. Slightly easier than highlighting the whole thing for copy/paste into your browser.

I dont think VS 2010 environment allow you do so, pls go through links, there are some shells which allow you to do so
https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2723548-open-links-in-an-actual-browser
http://social.msdn.microsoft.com/Forums/vstudio/en-US/22ffd60b-5fcf-4ed4-b42c-546d389b4be1/open-url-in-external-browser
If you find a way please post

Right click on the aspx page and go to browse with choose the browser, and select as default, as is suggested here:
http://www.hanselman.com/blog/HowToChangeTheDefaultBrowserInVisualStudioProgrammaticallyWithPowerShellAndPossiblyPokeYourselfInTheEye.aspx
they also go into more detail about how to fix it if there isn't an aspx page in your project

Related

How to see the value of a parameter inside a With-Block while debugging?

When debugging in a Visual Basic Project in Visual Studio 2019, I can't see the values of parameters inside a With-Block when I'm hovering over it with the mouse.
I have Resharper Ultimate installed, but it seems like it doesn't provide a function to show it either.
When using a With-Block the values of ".Name", ".URL", etc.
aren't shown when hovering over them in debug mode:
Private Sub AddCustomer()
Dim theCustomer As New Customer
With theCustomer
.Name = "Coho Vineyard"
.URL = "http://www.cohovineyard.com/"
.City = "Redmond"
End With
With theCustomer.Comments
.Add("First comment.")
.Add("Second comment.")
End With
End Sub
When it is this way, the debugger shows the values just as usual:
Private Sub AddCustomer()
Dim theCustomer As New Customer
theCustomer.Name = "Coho Vineyard"
theCustomer.URL = "http://www.cohovineyard.com/"
theCustomer.City = "Redmond"
theCustomer.Comments.Add("First comment.")
theCustomer.Comments.Add("Second comment.")
End Sub
How can I see the values? Or is there a way to convert the With-Blocks automatically to regular expressions?
Works for me:
Are you sure that you are talking about VB6? Resharper Ultimate sounds more like an extension for Visual Studio.
I can't see the values of parameters inside a With-Block when I'm
hovering over it with the mouse.
Do you use DataTips?
I test it in VS2019 16.1(Community and Professional Edition). In a VB.net console app using your example code, we can use DataTips to monitor variable value in debug mode.
Hover over the thecustomer variable and we can get its details during debugging.If this option not work in your side, try repairing VS or update it to latest VS version.
Hope it helps:)

VBA for MAC navigating browser with elaborate functions

I have a Google Analytics Macro that works perfectly fine in Windows, but I need to use it in MAC.
I am having trouble with opening a browser and navigating in it. This is an example of code that I use and didn't find support in MAC:
Set HTMLDoc = oIExplorer.document
HTMLDoc.all.Email.Value = GAlogin ‘this is a string I got in another part of the code
HTMLDoc.all.passwd.Value = GApassword ‘this is a string I got in another part of the code
For Each objButton In HTMLDoc.getElementsByTagName("input")
If objButton.Type = "submit" Then
objButton.Click
Exit For
End If
Next objButton
I found ways to open and navigate browser, but none of them would support this kind of code. More specifically, none of them allowed the getElementsByTagName part nor going through the elements and clicking a button.
Does anyone know how I could navigate and use a browser in MAC that would support this functions?

Where does Visual Studio stores the default browser to use in debug?

I'm using Firefox as my default browser but when working in Visual Studio, I'd like to fire up IE when I go in debug.
We all know that in MVC application, there's no way to choose the default browser unless you add a web form file, right click it, select browse with and then force a browser to be the default one. Great.
My simple question is: where does VS stores the browser I just tell him to use (registry? project file? some xml config file?) I'm asking because VS loose this preference several times a month. I'm fed up with making the brower trick again and again.
Thanks in advance,
Fabian
I found these settings eventually.
They are stored in an XML file called browsers.xml in thge following directory:
**C:\Documents and Settings\%USERNAME%\Local Settings\Application Data\Microsoft\Visual Studio\9.0**
The XML should look like this:
<?xml version="1.0"?>
<BrowserInfo>
<Browser>
<Name>Firefox</Name>
<Path>"C:\Program Files\Mozilla Firefox\firefox.exe"</Path>
<Resolution>0</Resolution>
<IsDefault>True</IsDefault>
<DDE>
<Service>FIREFOX</Service>
<TopicOpenURL>WWW_OpenURL</TopicOpenURL>
<ItemOpenURL>%s,,0xffffffff,3,,,</ItemOpenURL>
<TopicActivate>WWW_Activate</TopicActivate>
<ItemActivate>0xffffffff</ItemActivate>
</DDE>
</Browser>
<Browser>
<Name>Internet Explorer</Name>
<Path>"C:\Program Files\Internet Explorer\IEXPLORE.EXE"</Path>
<Resolution>0</Resolution>
<IsDefault>False</IsDefault>
<DDE>
<Service>IExplore</Service>
<TopicOpenURL>WWW_OpenURL</TopicOpenURL>
<ItemOpenURL>"%s",,0xffffffff,3,,,,</ItemOpenURL>
<TopicActivate>WWW_Activate</TopicActivate>
<ItemActivate>0xffffffff,0</ItemActivate>
</DDE>
</Browser>
<InternalBrowser>
<Resolution>0</Resolution>
<IsDefault>False</IsDefault>
</InternalBrowser>
</BrowserInfo>
The <IsDefault> tag determines whether or not the browser is used for debugging.
Alternately you can use this extension: http://visualstudiogallery.msdn.microsoft.com/bb424812-f742-41ef-974a-cdac607df921/
Suggest from question: Visual Studio opens the default browser instead of Internet Explorer
And, yes. This works with ASP.NET MVC applications as well.

Is there something like Emacs' toggle-read-only in Visual Studio?

The subject says it all. Is there an easy way to toggle the editability of a buffer in Visual Studio? This would be similar to the toggle-read-only command in Emacs.
I am not looking to change the file attribute ... just whether I can edit the file while it is open in Visual Studio. I am using 2008 and 2005.
Why would I want to do this? I tend to have several files open at the same time .... for days at a time sometimes (perhaps a bad habit) and I have +/- a char or few here and there without meaning to or noticing ... also worried about "the cat walking across the keyboard"
Besides ... an "ancient" code editor like emacs has it :) and I grew to expect the feature.
TIA!
There is an extension for Visual Studio called CodeMaid that will give you a Read-Only Toggle per file.
http://www.codemaid.net/documentation/#andmore
You can download it at http://visualstudiogallery.msdn.microsoft.com/76293c4d-8c16-4f4a-aee6-21f83a571496
You can use this piece of vba
Public Sub ToggleReadOnly()
Dim doc As Document
doc = DTE.ActiveDocument
If (doc.ReadOnly) Then
doc.ReadOnly = False
Else
doc.ReadOnly = True
End If
End Sub
Note: the msdn documentation specifically mentions that the property ReadOnly shouldn't' be used explicit but I verified that this works for me on vs.net 2005.
I also verified that the actual file attribute isn't changed.
I'm not aware of anything that will quickly achieve what you're looking for. Furthermore, I'm not really sure why you would need such a thing. Typically I use subversion to tell me which files have been changed and where they have been modified that way I can revert anything that doesn't belong.
Can you expand on your question a little to let us know what your usecase is?
If you really need to toggle readonly....perhaps you can:
Right click on the file
Select Open Containing Folder
Right click on the file and choose properties
Check the readonly checkbox
Start Tools->Macros->Macro IDE. Add new module (described here in details) and define there procedure as follows:
Imports EnvDTE
Public Sub SwitchReadOnly()
DTE.ActiveDocument.ReadOnly = Not DTE.ActiveDocument.ReadOnly
End Sub
Assign macro to keyboard key(described here in details). That's all.

"SVN Blame" plugin for VisualStudio

I found this question but the referenced options don't say anything about supporting "blame". What I'm looking for is an integrated way to ask "Who edited the line under the cursor last?".
I know most/all SVN clients give this in some form but I'd like something that makes it easy enough that I can do it on a whim: "Humm, who wrote that? [tap tap] Oh him."
The daily builds of AnkhSVN 2.0 have a completely new annotate (blame) implementation inspired by the TFS annotate feature.
(source: qqn.nl)
Not really visible in these screenshots, but it uses the Visual Studio editor for syntax coloring, etc. (You can see the sizeof() in the right bottom of the next image is blue). As you can see in the second picture it also allows several commands on the revision regions in the left bar.
It currently doesn't implement the jump to active line. But you can use the Visual Studio goto line (Ctrl+G) command in it. (You might be able to script this in a macro)
The easiest way to start annotate is right click on the editor ->Subversion->Annotate.
(source: qqn.nl)
[Update 2009-02-03: This feature is now commonly available in the new Stable release]
I wrote a Visual Studio macro to get line number info and pass it to tortoiseproc.exe (which is part of TortoiseSVN)
Take a look at the parameter info:
http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-automation.html
Here is my macro:
Sub Blame()
sCurrFileFull = DTE.ActiveDocument.FullName
Dim activeDoc As Document
activeDoc = DTE.ActiveDocument
Dim nLine As Integer
nLine = activeDoc.Selection.CurrentLine
sShellCommand = sTorEXE & " /command:blame /startrev:1 /endrev:-1 /path:""" &
sCurrFileFull & """ /notempfile /line:" & nLine.ToString()
Shell(sShellCommand, AppWinStyle.MaximizedFocus, False)
End Sub
I use a set of external tools wired to TortoiseProc.exe to perform SVN operations like log, diff, blame, revert, commit, update, etc. Then I create toolbar shortcuts to these external tools so that I have all the basic SVN operations accessible within the IDE.
Here are the steps to create a button to do a blame on the current file:
Go to tools -> external tools and click "Add"
Enter whatever title you want (e.g. "Blame")
For the command, enter the following (the path will be different if you installed TortoiseSVN to a different directory): c:\Program Files\TortoiseSVN\bin\TortoiseProc.exe
For the arguments, enter the following: /command:blame /path:"$(ItemPath)" /notempfile
For the initial directory, enter:$(ItemDir)
Now, whenever you have a file open, simply go to tools -> Blame and it should generate the Blame in a popup window. You can also customize the toolbar and create a shortcut for this external tool to make it even easier.
In VisualSVN supports blame to some extent - you can right-click on a file and select "Blame". However, it pops up a new window, which may not be as integrated as you want.
Here's a working version of crashmstr's and Derek Dahmer's macro code:
Sub Blame()
Dim sCurrFileFull = DTE.ActiveDocument.FullName
Dim activeDoc = DTE.ActiveDocument
Dim nLine = activeDoc.Selection.CurrentLine
Dim sTorEXE = "TortoiseProc.exe"
' Add path if you don't have TortoiseSVN on your PATH
Dim sShellCommand = sTorEXE & " /command:blame /startrev:1 /endrev:-1 /path:""" & sCurrFileFull & """ /notempfile /line:" & nLine.ToString()
Shell(sShellCommand, AppWinStyle.MaximizedFocus, False)
End Sub
As per Derek Dahmer's instructions, add it to a new or existing macro module using the Tools > Macros > Macro IDE.
For easy access, I added the macro to my code window context menu:
Customize > Commands > Context menu > Editor Context Menus | Code Window
Add Command > Macros > Find your macro
Modify Selection > Name: Bla&me
Having it in the context menu enables easy keyboard access, but you can, of course, add a keyboard shortcut to it as well. I have it on Ctrl-Shift-M, which is not used by anything useful by default :).

Resources