How Could I Debug 2 Application at same time in VS 2012? - visual-studio-2010

I have Solution that contain 2 projects
1- Windows App(contain Form)
2- Web App (Contain Default.aspx)
and i want them to open at same time
How could I do this ?

Here is another scenario. You set your Web App project directory as virtual directory in IIS and it runs. You can go http://localserver/..../default.aspx... Then you can run your Windows application by pressing F5 if it is set as startup project, or go to project-debug-start new instance. At this point you debugging your windows app. Now, go to tools-attach to process and attach to your web application process. Voila - you debugging both applications/projects at the same time.

One way would be to open a second Visual Studio instance, debug the Windows App with the first instance and the Web App with the second instance. Keep in mind that this costs some performance on your PC.

Related

VS2010 website debugger in wrong VS instance

we currently have 2 developers working on 2 different websites, on the same server.
when an error occurs in one of the web applications, that debug option pops up for the wrong developer. how do we specify what VS instance is to be used for which w3wp debugger process attached?
Here are a couple of options sorted from best to worst...
Run Visual Studio locally on the developer's computers so this isn't a problem.
On the server, use Visual Studio's web server instead of IIS. This gives each user an automatically created local process that can be debugged.
If you must use IIS, configure each application in IIS so that they run in their own application pools. Each application pool gets its own w3wp process so your Visual Studio instances can attach to their own process.

Visual Studio 2013 launches the wrong MVC Application

This seems like a typical Microsoft bug. I have a project that when I click launch despite the fact that it's set as the default project is launches a skeleton MVC app as opposed to the MVC app that I'm currently working on.
To fix the problem I have to close down Visual Studio completely and relaunch my solution. I press f5 or just run the app and it works.
What I find interesting is this mysterious skeleton app which seems to be ASP.NET temporary files is the same port as my project. This happens multiple times a day while developing this particular app on the particular port. Does anybody know why Visual Studio 2013 is doing this?
Okay so this is a Microsoft bug. It turns out the project I'm working on does have identical names to another project that I was working on except in a different codeline. Visual Studio gets all confused and launches the old app in cache instead of the app I'm working on. The only way to fix this it appears it to manually change the port number for IIS Express.
For more information check this out.
https://connect.microsoft.com/VisualStudio/feedback/details/786645/vs-launches-the-wrong-mvc-website-when-two-identically-named-solutions-are-open-at-the-same-time

How can I find out what debugger is attached to w3p.exe

I'm trying to setup debugging on a class ASP project in VS 2010, and in doing that am trying to attach it's debugger to w3p.exe. I'm using Windows 7 64-bit and IIS 7.5. I've used this method successfully a few times before on another machine.
However, I'm finding that this time I am unable to attach the debugger. It's saying:
Unable to attach to the process. A debugger is already attached.
But I can't figure out what it might be. How can I determine this? Or could it be something else? I've rebooted my PC and can't yet see signs of anything running which looks like a debugger.
Setup
In case it helps, here's the steps I used to setup the environment, which I documented from my previous successful attempts:
Created new empty Visual Basic .NET Web (Best to create in C:\inetpub\wwwroot\, otherwise you will have security/ACL issues when loading the site).
Copied the contents of site folder to project folder.
In solution explorer, selected to show all files not in project. Selected all files and right click and select: "include in project".
Under project properties -> Web -> Set to use IIS and start with URL http://mysite.local
In hosts file pointed mysite.local to 127.0.0.1
In IIS setup new website pointing to the files with a host header of mysite.local
Go to application pools, ensured mysite.local was set to classic mode. No managed code.
Under ASP -> Enable Parent paths and make sure server-side debugging is enabled
Under error pages, make sure full details are shown.
Debugging in Visual Studio 2010
Run VS 2010 as Administrator
In your project, use Ctrl+F5 to run without debugging
Now, in the menu go to Debug -> Attach to Process -- This is where I fail
Tick show processes from all users AND show processes in all sessions
Make sure it is set to automatically determine type of code to debug
Look through the w3p.exe processes in the list, and based on the IIS POOL\site name, pick the right process.
Set your breakpoints and refresh -- debug as normal.
Are you having some Debug Diagnostics Tool running on your machine. Sometimes back i had the same problem the Debug Diagnostics Tool was debugging my w3p process.

How to debug two web applications/services on IIS from within Visual Studio?

In Visual Studio 2010,
I want to debug two web applications running on IIS at the same time.
When debugging the first application it is ok. But when starting to debug the second application and first program is still in debug mode, Visual Studio prompts:
unable to start debugging on the web server. a debugger is already
attached
How can I solve this problem?
To summarize, one has to set different application pools in IIS for the two applications to debug.
Here is a rough instruction, given that both applications have been deployed to IIS once within Visual Studio.
Open the Internet Information Services (IIS) Manager
Click Application Pools on the left pane
On the right pane add another integrated application pool, let's name it Second ASP.NET 4.0 Integrated
For one application, open the Advanced Settings...
In the properties view finally select Second ASP.NET 4.0 Integrated as the application pool
This way the applications should be debuggable in parallel because each Application Pool spawns a new operating system process to which a separate debugger can be attached.
A windows process can only have one debugger attached to it at a given time. If you get that message it means that you're attempting to debug the same process twice which won't work. But that also means you should be able to debug both web applications in the instance of Visual Studio that's already attached. It may require a few extra steps though to get it to acknowledge the other code
Disable "Just My Code" (Tools -> Options -> Debugger, uncheck "Enable Just My Code"
You may need to manually load symbols for the other web application through the modules window (Debugger -> Windows -> Modules)
After that though (second step may not be necessary) you should be able to set break points in both web applications and otherwise debug them.

Debugging a site using web service with Visual Studio 2008

I've got a solution with many projects
One of these proejcts is a "MyProject.Web" web application.
This has a web reference to MyProject.WebService" project -
I have a breakpoint in the WebService project, and i call the method on one of my Web forms, the break point is not hit....
How can i enable this?
Right-click on the solution and choose "Set Startup Projects". Choose to start multiple projects and select both your web site and web service to start with debugging. Then when you start the debugger they will both fire up and you should have full debugging in both.
I ran into this too a while back and this is what I followed:
http://dansen.wordpress.com/2008/04/15/debugging-wcf-clients-and-services/
Visual Studio has feature that
supports attaching to multiple
projects when starting up.
In this example, I have a WCF service
hosted in IIS which lives in the
Wcf.Demo.IisServiceHost project. I
also have a Wcf.Demo.TestHarness
project which calls the service. I
want to be able to attach the debugger
to both the client and service by
simply pressing F5.

Resources