How to keep IIS Express running after finished debugging? - visual-studio-2010

I'm using IIS 7 express to test a ASP.Net MVC 3 project on my development machine and normally it keeps running after I finished debugging, which is a good thing so that I can perform small tests directly in the browser without needing to run the project again.
But if I choose the option "Enable edit and continue" on the project properties IIS 7 will only run while debugging the project. Is there a way to change this behavior?

No, because in order to achieve this, Visual Studio uses a hosting environment that interprets the code being executed.
So, it is only available while debugging.

There is global setting in Visual Studio to have 'Edit and Continue' to be off by default for all new projects under Options > Debugging > Edit and Continue.

Just in case if you need this feature (IIS to continue running) in ASP.NET Web Forms, instead of pressing F5 (Run), right-click the start page in Solution Explorer and select 'View in browser'.

Related

Application Debugging is disabled in Visual Studio 2012 on Classic ASP Debugging

I'd like to debug Classic ASP website at Visual Studio 2012 with IIS Express. Hence, I attached the iisexpress.exe in VS 2012, but it shows Application Debugging is disabled. What could be a problem ? Do I want to enable any configuration settings?
First of all you need to enable server side debugging of classic ASP script. Do this by running the following commands:
"C:\Program Files (x86)\IIS Express\appcmd.exe" set config "[YOUR_SITE_NAME]" -section:system.webServer/asp /appAllowClientDebug:"True" /appAllowDebugging:"True" /commit:apphost
Where [YOUR_SITE_NAME] is the name of your website. You can find this name by opening up:
%USERPROFILE%\Documents\IISExpress\config\applicationhost.config
...and searching for your site.
Next, start an IIS Express instance from the command line:
"C:\Program Files (x86)\IIS Express\iisexpress.exe" /config:c:\users\kevin\Documents\IISExpress\config\applicationhost.config /site:"[YOUR_SITE_NAME]" /apppool:"Clr2IntegratedAppPool"
Again, [YOUR_SITE_NAME] is the name of your IIS Express website.
Then attach Visual Studio 2012's debugger and set a breakpoint in the script you wish to debug. Browse to your site/script and your should see the breakpoint light up:
Go to IIS-->ASP-->Debugging properties -->enable client and server side debugging
then attach w3wp process from VS2012
I don't have visual studio 2012 to test it on as far as I know visual studio cannot debug asp classic code natively.
The way I debug my asp classic code is to put in stop statements on the line above the one I want to debug
like this post says. the break point is just typing in stop.
function DoDate(inp)
stop
if isnull(inp) then
DoDate = "Never"
exit function
end if
In the above example the page when loaded will stop at the breakpoint and pop up a dialog asking if you would like to debug it, you can then step through the function and even see variables like you normally would.
note: The link says visual studio 2005 but it also works in 2010(and should also work in 2012), you also do not need the DEBUG extension.
also ensure you have server side debugging activated in IIS or this will not work.
I like using Full-blown IIS on my dev machine as it's what my web servers run and have had problems with differences between Casini and IIS in the past..
Anyway, I was unable to do it the way that #Kev suggested. I did some more playing around + reading and found that on the "Attach To Process" window, you need to specifically select "Script Code" in the "Attach To:" option.
1) F9 to set breakpoints in code
2) Ctrl-Alt-P to attach to process
3) Next to "Attach To:" click on the "Select" button
4) Select "Script Code"
5) In my case, attach to "w3wp.exe"
Enjoy debugging your code.

Getting error while trying to run a classic ASP website in Visual Studio 2010

I have a classic ASP website deployed over IIS.
I am opening that website from the same location in visual studio 2010 (in order to debug, as per the steps mentioned here
The problem is that, when I hit F5 in visual studio it is giving me an error saying "your server does not support debugging of asp net or atl..."
I am able to browse the site from IIS, but I want to open it in Visual Studio in order to debug it.
What could be the possible reason and solution of this issue?
F5 doesn't do anything good for classic ASP sites (f5 will try to compile a .NET site and then access it).
I will assume that you are trying to debug the site on the same machine where it's running. The way you debug "classic" ASP using Visual Studio.NET is by attaching to the process running the site. The easiest way to do this is to use the Just In Time (JIT) feature: insert a stop statement in the code (debugger in jscript) - hitting that line should initiate a server-side "Error of type "Script Debugging" was encountered. Do you want to debug?" dialog, with suggestions of available debuggers to use.
Try this and report what happens - there might be some extra steps needed to configure that machine.
Are you using IIS 7?
If so you should the server option "Enable server side debugging"... It should be in the properties window of the site, using IIS Management Console.
Once you do that, when you run the server through Visual Studio, it should open another solution on debugging mode with the relevant code.

The Web Server Could Not Find the Requested Resource visual studio debugging

Issue
I have a .net 4.0 Web Application running in visual studio 2012, every time I go to debug the site i'm receiving the following error:
The Web Server Could Not Find the Requested Resource
What I've tried
I've followed microsoft's website with solutions: msdn
From a command prompt window, run the following command: systemroot\Microsoft.NET\Framework\ versionNumber \aspnet_regiis -i
I've also attempted to remove the .csproj.user files
Since we use Source Control i've deleted all items, the site and apppool and reconfigured from scratch.
AppPool is set to allow 32-bit applications
All to no avail...Anyone have a solution that might solve this visual studio debugging nightmare for me?
Steps:
Close all solutions in Visual Studio
open IIS7 (run > inetmgr)
Click your top node (computer name)
Open the "ISAPI and CGI Restrictions" option
check if your .Net version has the correct restriction (for example, if you're working with 4.0 is should be on "Allowed")
I was getting the same error when i was running the ASP.NET project from the IIS. I resolved this issue by configuring IIS.
Go to run
type appwiz.cpl and press enter.
Look for "Turn windows features on or off" and click on it
now windows will open for Turn windows features on or off
look for Internet Information service and select that option.
go to world wide web service under the Internet Information service branch
expand Application development feature
Select all the ASP and .net version. and click on OK.
now try running the application from asp.net , it will work :)
I had the same symptoms but a completely different problem. I had attempted to install Url Scan and it didn't seem to work correctly as I could not find the .ini file to edit settings within. I had forgotten that I had installed it, but it appears by default it will prevent debugging from working.
Uninstalling Url Scan solved the issue for me. To uninstall it I had to right-click on the .msi file and choose Uninstall. Url Scan did not show up under the "Add or remove programs" section.

Visual Studio 2010: very slow web applications debugging!

I recently installed Visual Studio 2010 (Ultimate edition, final version released in April), and found that debugging a web application became very slow (2-3 times slower than in Visual Studio 2008)!
I took the same web application and checked the speed of loading of one of its pages in VS 2008 and VS 2010, and compared the time it takes to load the page.
I tested it using 2 approaches: 1) debugging under ASP.NET Development Server (by pressing the "Start" button) and 2) using ASP.NET Development Server without debugging (by using the "View in Browser" menu command).
And I got the following results for Visual Studio 2008 and 2010.
1) ASP.NET Development Server withoud debugging ("View in Browser"): the speed of page loading is the same in VS 2008 and 2010.
2) Debugging under ASP.NET Development Server ("Start" button): in VS 2010 the page takes more time to load than in VS 2008 - VS 2010 debugging is 2-3 times slower than in VS 2008!
3) At the same time, when debugging a web application in VS 2008, it takes the same time to load the page compared to when using only the "View in Browser" command. That is, VS 2008 debugging does not introduce any overhead to page loading in the web browser!
I wanted to make sure that other people have the same problem with slow debugging of web applications in VS 2010. Can this issue be solved by any means?
BTW, I am using Windows XP SP3.
Thank you.
Disable Intellitrace (historical debugger) - it enable jumping "back in time" during debug but it slows down debugging.
You can disable it from the options->intellitrace
Try 'Delete all breakpoints' from the Debug menu. It sped up my web application debugging by 10 times.
I had problems with slow Visual Studio debugging when "Native Code" debugger was enabled. Try disabling it.
On "Visual Studio 2010" go to:
Project Properties ->
Web ->
Debuggers (bottom of page). ->
Disable all exept ASP.NET
Hope it helps.
Similar question: 1
After incredibly slow debugging for months I finally discovered the cause (even after disabling intellitrace).
It turned out to be PC Tools internet security -> IntelliGuard -> 'Behaviour Guard'
This is a hips like protection system that monitors the 'signature' of system operations
I disabled this feature and wow what a speed difference - 'stepping into' lines of code in debug now has almost zero delay. I re-enabled Intellitrace and can use it with only a very slight speed hit.
Tino
I tried a lot of things and the only way to solve it was the swax solution 'Delete all breakpoints'
I had this problem as well and it turned out to be due to sybmbols.
Go to Tools > Options > Debugging > Symbols and uncheck any symbol servers
Deactivate the option Show Parameter Values in the callstack window (debug -> windows -> callstack -> left click).
It required lots of recursion.
Reference
I did find out what you have to do:
Disable Intellisense
Disable the Graphics Rendering Editor Function, this causes editor slowness
with some graphics cards.
Disable the Sourcecontrol that is set by default to the Microsoft Server Product.
I just can tell you, that VS2010 is a very good product, if you
know these few things, and setup this.
You can uncheck the Symbols servers.
Try removing the localhost from the list of trusted sites in IE security settings.
For me it solved the problem of slow JavaScript debugging in VS 2010. It may work for you if you have added 'localhost' (or any other domain name you use for local development) to the trusted sites list, like I did.
I can get it faster by clear all break points, all unnecessary variable in Watch windows, and all the unnecessary debug windows, such as CallStack ...
I realized that ESET Internet Security also makes lots of performance issues while debugging in Visual Studio 2010 using ASP.NET Development Server.
Recently I faced with the same problem. I noticed that I had too many messages (especially "A first chance exception ...") in the VS's Output window. I fixed those exceptions and everything went fine.
What is expensive too sometimes is debugging the JavaScript libraries you are using or developing.
Checking the option "Don't open a page" in the project property window allows you to debug the web application without debugging JavaScript. You simply have to open the web application in your browser manually.
In some circumstances debugging JavaScript can break the responsiveness of the debugging process and if you know that your concern is with the .NET debugging, you can make load time faster that way easily.
Taking another route of Paulius' answer (disabling "Native Code" debugger) I was able to speed up the debugging. Here are the steps I took for VS 2010 Pro:
1) Tools > Options > Debugging > General
2) Ticked Enable Just My Code (Managed Only)
3) Also this might help, unticking Enable address-level debugging
There is another trick you can do:
1) Go to (Ctrl + Alt + Del) Task manager > Processes
2) There are 2 main processes for visual studio debugging, 1)devenv.exe 2) WebDev.Webserver40.exe (Or similar).
3) Right click on each of the bove processes > Set Priority > Real Time. Click Ok in the message Box.
Speeds up debugging dramatically!.

How do I keep the development web server (Cassini) running in Visual Studio 2008?

I'm using Visual Studio 2008 to develop ASP.NET applications. Currently I'm debugging with running on IIS. I would like to switch to the development web server (Cassini) for debugging, so that I can use features like edit and continue. The reason that I'm not, is because the development web server only starts up when you are in debug mode. Is there any way to keep it running all the time, and just have Visual Studio attach to the existing server process like it does with IIS?
Rihan is partially correct...
In your Project Property page, Web tab: Enable Edit and Continue
If checked - The Development server will close when the app (not VS) stops.
If unchecked - Development server keeps running
You can also start your cassini server from the command line which takes alot of pain out of the whole "debug" effort...
Check out a good snippet here on how to do this: https://thoughtjelly.wordpress.com/2009/05/13/launch-cassini-from-the-command-line/
Once started, the built-in web server continues executing even when you stop debugging, as long as your VS2008 project is still open. Just start up the debugger when you want to start debugging again. I typically have another browser window open and interact with the built-in web server from there instead of the browser window that it opens so I can keep working with the application in the same state even after turning off the debugger (which closes the opened browser window).
I'm running VS2008 on Windows XP SP3.
The simplest way I have found to acheive that is by launching the debugger as normal. Then in Visual Studio goto the Debug menu, and select detach all. It detaches from the Cassini web engine, but it does not shut it down, as it does when stopping debugging.
I am quite sure you are know that there is command line swithces that you can you use to launch the cassini engine, but my guess is you are looking for something slightly easier.
Detaching does not close the browser window that visual studio launched, and if you do close that spesific web window then it will stop debugging.
I am running VS 2008 SP1 on Vista 64x SP1 without IIS.
Hope it helps
Rihan Meij
I have 3 web sites, with Single sign on between each site so I need to start all 3 with attach to process. However, there was no process to attach the debugger to, and whenever I started a project with F5 then stop it, the visual studio web server closed.
The Enable Edit and Continue option didn't change anything.
So to start the web server and keep it running so that you can attach the web project to the process, I simply did a "view in Browser" (ctrl+shift+W). This started the server process but not the project nor the debugger. I could then attach to process easily.
In Visual Studio 2015 you do this by going to Tools > Options > Debugging > General and unchecking the "Enable Edit and Continue" option:

Resources