Attach to process in VS2010 express using a web site. Is it possible? - visual-studio-2010

I have read this article but it applies to web projects with a .csproj... What about a 'web site'?
http://www.ninjatrader.com/support/forum/showthread.php?t=15671
People at work here tell me to just response.write my way to debug the web sites but I really miss the attach to process that is in the professional edition of vs2010.. or maybe I have to get used to response.write debugging?
(Reason I am not debugging is ektron 8.0 does not compile is vs2010.. so I must attach to process.. or use vs2008)

Visual Studio 2010 Express Edition supports Attach to process but it is available only in Expert Settings.
Go to Tools->Settings->Expert Settings.
After this change, you should see Attach to Process button in Debug menu.

It isn't available for VS2100 Express. Check the link. http://msdn.microsoft.com/en-us/library/vstudio/c6wf8e4z(v=vs.100).aspx

An option for websites hosted on another application (Like IIS) is to use the property pages.
Right Click on Project/Website in Solution Explorer->Property Pages->Start Options
Launch VS2010 Express (or VS2012 Express) as Administrator
Set "Start Action" radio-button to "Don't open a page. Wait for a request from an external application."
Set "Server" radio-button to "Use Custom Server"
Set the "Base URL" textbox to your site url.
Verify the Debuggers: ASP.NET option is checked.
Hit F5 to launch the debugger, then request the page in the browser.
Then, linking to the website is as easy as pressing the play-debug button and navigating to your url.
NB: This was tested in VS Express for Web 2012 (ver. 11.0.50727.1) on a Web Site project.

Just like said in the post above, you can use "Attach to process" in visual studio express. But it's not necessary to change your settings to "expert settings". All you have to do is add the command to the debug menu.
Tools-> Customize -> Commands -> Menu bar: Debug -> Add Command... -> Debug -> Attach to Process

Try this:
right click on toolbar/menu Customize/tab Commands/button Add Command/left list Debug/right list Attach to Process.../button OK/button Close.
for me works crtl-alt-p shortcut too.
.. voila!

Related

How to disable the new debug window in VS2017

I'm using Visual Studio 2017 RC and getting very frustrated with the new Chrome window that pops up when you click Debug.
Issues with the Debug Chrome Window:
Takes ages to start/"attach" website (I think it's attaching all the javascript debugging which I don't need because I use Chrome DevTools for that anyway)
Not dockable (as a tab) with other Chrome windows
Doesn't remember form history. If I'm testing out forms I can't autocomplete form data, so I have to type the whole lot out every time
Doesn't remember url history. If I'm testing a specific page on my site, I can't quickly select the url from Chrome url bar dropdown. Have to type the url in full
Extensions aren't enabled so I can't use my ruler or color picker extensions
Chrome window closes when debugging stops so I have to open up a new window to keep browsing the local site
Does anyone know how to disable this new Debug style window and go back to how it was in VS 2015?
I'm not sure if this came with the latest VS 2017 Update, but inside Debug -> Options you can disable it now.
Just uncheck the highlighted one:
For thoose, who have the 15.7 update and unchecking the JavaScript options doesn't do the trick, found a solution here:
https://blogs.msdn.microsoft.com/webdev/2016/11/21/client-side-debugging-of-asp-net-projects-in-google-chrome/
Tools > Options > Projects and Solutions > Web Projects, uncheck “Stop debugger when browser window is closed”
This is not an issue, rather a new feature in VS 2017. Previously we could only debug JS and TypeScript using IE in debug mode (of VS). But now they have introduced debugging JS and TS inside VS using Remote Debugging feature of Chrome. If you are running your application in debug mode (pressing F5) and Chrome is selected browser, Visual studio 2017 will try to open a remote debugging session with Chrome on a dedicated port. With remote debugging,
The browser is launched in plain mode, i.e. no extension and no history etc. Remote debuggin doesnt work with an existing instance of Chrome already running.
You always see this window for a while. At this point, VS is trying to attach the remote debugger to VS
To go back to VS 2015 experience of debugging, change the debugging target from Chrome to IIS Express.
This post describes this feature in detail. https://blogs.msdn.microsoft.com/webdev/2016/11/21/client-side-debugging-of-asp-net-projects-in-google-chrome/
A kind of quick work around is to press F5 and launch the debug
session and forget about the newly opened Chrome window. Go to your
normal Chrome instance and just open your site in new tab. You will
still be able to debug and do everything because IIS Express will
still be running your app at that port.
Update:
The answer given below by #Steveadoo is the right way going forward. The option shown in his screenshot controls how chrome is launched for debugging. Uncheck it if you want to stick to your regular Chrome instance.
Hope this helps.
For VS 2017, Go to Tools -> Options -> Projects and solutions-> web projects and uncheck the last option as shown in image.
Also you can refer here: https://www.johanbostrom.se/blog/how-to-disable-the-built-in-chrome-from-starting-when-debugging-in-visual-studio-2017
Here is the Microsoft blog about this new functionality, and how to revert.
https://blogs.msdn.microsoft.com/webdev/2016/11/21/client-side-debugging-of-asp-net-projects-in-google-chrome/
Here is the path I followed to disable:
Debug > Options > Debugging > General > (uncheck) Enable JavaScript debugging for ASP.Net (Chrome and IE).
In VS menu click:
Tools > Options > search for "browser projects" > untick the last option "Stop debugger when browser window is closed.
this will do the job.
Debug > Options > Debugging > General > (uncheck) Enable JavaScript debugging for ASP.Net (Chrome and IE).
Tools > Options > Projects and Solutions > Web Projects, uncheck “Stop debugger when browser window is closed”
works for me, visual studio professional 2017, v 15.7.3
I'm using Visual Studio 2017, and what worked for me is a combination of these two options:
Disable JavaScript debugging in Debug -> Options -> Debugging -> General Enable JavaScript debugging for ASP.Net.
Disable stop debugging when browser is closed in Debug -> Options -> Projects and Solutions -> Web Projects -> Stop debugger when browser windows is closed, close browser when debugging stops.
When I used only one of these two it did not work.
if you look to JavaScript case
For Enabling and Disabling JavaScript Debugging in VisualStudio is the same on all versions
Tools menu
Options...
Debugging -> General
Uncheck "Enable JavaScript debugging for ASP.NET"
In Visual Studio 2017:
If it prompts you again to turn JS debugger on again, choose another option (It will continue to prompt you if you have breakpoints in your script code):

Express version missing Debug-> exceptions menu

I use. VS 2013 Express
When debugging, I need to stop automatically on exceptions.
try to follow this.
http://msdn.microsoft.com/en-us/library/d14azbfh.aspx#AddExceptionsCommand
It says I need to add Exceptions command to the Debug menu
On the Tools menu, click Customize.
The Customize dialog box appears.
Click the Commands tab and, in the Menu bar list, click Debug.
Click Add Command.
In Categories in the Add Command dialog box, click Debug.
In Commands, click Exceptions and then click OK.
But in stage 6, in Commands there is no Exeptions
Also I tried to remove Enable just my code, And it didn't work.
Just a FYI ---
Im am using VS Express 2010 (VB) and didn't see the debug exceptions.
Based on the screen shot above I just pushed CRLT-ALT-E and it opened.. (!)
Its a bit unclear to me, if VB 2010 Express has this option or not, or how to unhide it, but the key click combo opened it.
I was then able to turn off the option I needed
In my case the "PInvokeStackImbalance"
enter image description here
Another user has reported the missing 'exceptions' on the 'debug' menu to Microsoft and actually got an acknowlegement from Microsoft (though not from the product team and not confirmation that it is a bug).
https://connect.microsoft.com/VisualStudio/feedback/details/882780/exceptions-comman-missing-in-vs-2013-express-for-web
For what it's worth, you can add your vote to this report at that site; I'm experiencing this problem and I have done so too.
Here's a potential work-around: the 'exceptions' is present in the Visual Studio Express for Desktop. And you can install that edition side-by-side with Web edition. If you can figure out a way to invoke your project executable from the debugger in the Desktop edition, you'd have control over exceptions there.
The exceptions menu isn't shown in Visual Studio Web Developer Express. It is only shown in Visual C# Express.
You can however break on all exceptions. You can try to turn off "Just My Code" debugging, which will catch exceptions thrown in CLR code and linked libraries.
To do this, open Tools -> Options -> Debugging -> General, and uncheck "Just My Code" (or Enable Just My Code).
if it doesn't work try
Debug -> Exceptions -> Common Language Runtime Exceptions - check "when thrown"
if you don't see exceptions try to change your settings following this guide
Refer here for documentation.
update
if it still not working try this
Tools menu >> Import and Export Settings >> Reset all settings. Then choose C# Development Environment.
Many of the customization and integration features for Visual Studio's IDE are not available in the free Express editions, but you should be able to get to the Exceptions menu easily enough without using them.
Press F5 to start debugging, then select Debug / Exceptions... Turn on the check box for "C++ Exceptions" "Thrown". Hit "OK"

Visual Studio 2012 change web browser

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

How to make IIS Express the default web server in Visual Studio?

Is there a way to set IIS Express as the default launch option in Visual Studio 2010 SP1? Currently, it uses Visual Studio Development Server by default and one has to execute "Use IIS Express..." command manually.
Right click on the Default Startup project file in your Solution explorer.
Select "Properties".
Click on the Web Tab on the left hand side
scroll down and select the "Use Local IIS Web server radio button
Tick the checkbox "Use IIS Express"
Another useful tid bit in the section is that you can tell IIS not to launch browsers when you debug and just wait for a browser process to hit it. This is really nice for cross-browser testing.
Just above the previous said section, look for a radio button titled "Don't open a page. Wait for a request from an external app" under Start Action section of the same page
EDIT:
To set all projects made to behave this way do the following:
Tools -> Options
Projects and Solutions
Web Projects
Tick "Use IIS Express for new file-based web sites and projects

Choose browser to launch when debugging ASP.net (Visual Studio)

Is there anyway to have Visual studio start up a certain browser when running asp.net project?
Open any Web Form
File->Browse With...
Select from the list and hit "Set as Default"
yes
navigate to any aspx file in solution explorer
Right click browse
with and set your default browser
See here

Resources