Why would my ASP.NET project run on the development server when not among the startup projects?

我是研究僧i 提交于 2020-02-02 02:14:47

问题


I have a visual studio 2008 solution that includes an asp.net-hosted remoting project in c#. The solution also contains other c# projects and c++ projects.

When debugging the interaction between my c# client and the asp.net server, the debugging is great. I can literally step into server calls and back out. However, there are times in which I need to focus my debugging on a standalone executable without the asp.net project.

My trouble is that, after settings the startup project(s) to other projects besides the asp.net project does not prevent the asp.net project from launching in the development server (and system tray). It doesn't appear to be "debugging" per se, but it IS running and using up resources when I don't want it to be.

I have checked and rechecked the startup project settings. They are firmly in the "off" position. Any thoughts on why this would happen and/or how to prevent it? Has anyone else experienced this?

Solution Notes: Chalk this one up to the "oh that's where that is!" phenomenon in Visual Studio. This setting isn't on the ASP.NET project properties page (right-click on project in solution explorer and choose "properties"), and isn't on the startup projects UI. Instead it is on the "regular" properties page when the project is selected in the solution explorer. i.e. ensure the properties page is visible (View->Properties Window) and then click on the ASP.NET project in solution explorer. The top option is "Always Start when Debugging" which, when set to false, solved the problem.


回答1:


To stop the the development server from starting.

  • Click on the ASP.net project in Solution explorer.
  • IN the property window set "Always Start When Debugging" to false



回答2:


I think VS when you hit "debug" will only attach to the Start Project process.

Once you have the development server running, attach to the WebDev.Webserver.exe process.

Go to Debug Menu -> Attach to process ->select WebDev.Webserver.exe ->click attach

You should be able to catch it now.



来源:https://stackoverflow.com/questions/482012/why-would-my-asp-net-project-run-on-the-development-server-when-not-among-the-st

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!