在asp.net中调试两个Web应用程序

时间:2021-02-05 01:46:12

I have a solution file containing multiple web applications and components. Mostly these web applications operate independently of one another, but I need to be able to response.redirect from one application to another. This works, and the new page runs, but I can't step into the code in the second web app and debug it.

我有一个包含多个Web应用程序和组件的解决方案文件。大多数这些Web应用程序彼此独立运行,但我需要能够从一个应用程序响应.redirect。这是有效的,新页面运行,但我无法进入第二个Web应用程序中的代码并进行调试。

I have both web applications set to "Always Start When Debugging" = True, with the first web app (the one that's redirecting) set as the startup web application. Does anyone know a trick that will let me step into the code in the second web application?

我将两个Web应用程序设置为“调试时始终启动”= True,将第一个Web应用程序(重定向的应用程序)设置为启动Web应用程序。有没有人知道一个让我进入第二个Web应用程序代码的技巧?

2 个解决方案

#1


Open up a second instance of Visual Studio, then Ctrl+Alt+P (menu Tools > Attach to Process) then attach to the appropriate web server process (if you run under IIS this may be w3wp.exe or aspnet_wp IIRC, if you use the built in web server then attach to the process which lists the appropriate port for your project).

打开Visual Studio的第二个实例,然后按Ctrl + Alt + P(菜单工具>附加到进程)然后附加到相应的Web服务器进程(如果您在IIS下运行,这可能是w3wp.exe或aspnet_wp IIRC,如果您使用然后,内置的Web服务器将附加到列出项目的相应端口的进程。

Optionally just run the second one and manually go to the first one in your browser by entering the appropriate address and trigger the redirect which you have verified is working.

(可选)只需运行第二个并通过输入相应的地址手动转到浏览器中的第一个,然后触发已验证的重定向工作。

#2


Are both web applications running in the same process? What version of ASP.Net, IIS, and the .Net framework are you using? Those are my initial questions before I start giving other ideas.

这两个Web应用程序是否在同一进程中运行?您使用的是什么版本的ASP.Net,IIS和.Net框架?在我开始提出其他想法之前,这些是我最初的问题。

#1


Open up a second instance of Visual Studio, then Ctrl+Alt+P (menu Tools > Attach to Process) then attach to the appropriate web server process (if you run under IIS this may be w3wp.exe or aspnet_wp IIRC, if you use the built in web server then attach to the process which lists the appropriate port for your project).

打开Visual Studio的第二个实例,然后按Ctrl + Alt + P(菜单工具>附加到进程)然后附加到相应的Web服务器进程(如果您在IIS下运行,这可能是w3wp.exe或aspnet_wp IIRC,如果您使用然后,内置的Web服务器将附加到列出项目的相应端口的进程。

Optionally just run the second one and manually go to the first one in your browser by entering the appropriate address and trigger the redirect which you have verified is working.

(可选)只需运行第二个并通过输入相应的地址手动转到浏览器中的第一个,然后触发已验证的重定向工作。

#2


Are both web applications running in the same process? What version of ASP.Net, IIS, and the .Net framework are you using? Those are my initial questions before I start giving other ideas.

这两个Web应用程序是否在同一进程中运行?您使用的是什么版本的ASP.Net,IIS和.Net框架?在我开始提出其他想法之前,这些是我最初的问题。