为什么我的 ASP.NET 项目不在启动项目中,却在开发服务器上运行?
我有一个 Visual Studio 2008 解决方案,其中包括一个 c# 中的 asp.net 托管远程项目。 该解决方案还包含其他 C# 项目和 C++ 项目。
在调试我的c#客户端和asp.net服务器之间的交互时,调试效果很棒。 我实际上可以进入服务器调用并退出。 然而,有时我需要将调试重点放在没有 asp.net 项目的独立可执行文件上。
我的问题是,将启动项目设置为除 ASP.NET 项目之外的其他项目后,不会阻止 ASP.NET 项目在开发服务器(和系统托盘)中启动。 它本身似乎并不是在“调试”,但当我不希望它这样时,它正在运行并耗尽资源。
我已经检查并重新检查了启动项目设置。 它们牢牢处于“关闭”位置。 关于为什么会发生这种情况和/或如何防止这种情况有什么想法吗? 还有其他人经历过吗?
解决方案注释:将此归因于“哦,那就是那里!” Visual Studio 中的现象。 此设置不在 ASP.NET 项目属性页(在解决方案资源管理器中右键单击项目并选择“属性”)上,也不在启动项目 UI 上。 相反,当在解决方案资源管理器中选择项目时,它位于“常规”属性页面上。 即确保属性页可见(查看 -> 属性窗口),然后单击解决方案资源管理器中的 ASP.NET 项目。 最上面的选项是“调试时始终启动”,当设置为 false 时,可以解决问题。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
停止开发服务器的启动。
To stop the the development server from starting.
我认为当你点击“调试”时VS只会附加到启动项目进程。
开发服务器运行后,附加到 WebDev.Webserver.exe 进程。
转到调试菜单 -> 附加到进程 -> 选择 WebDev.Webserver.exe -> 单击附加
您现在应该能够捕获它。
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.