将Web应用程序附加到Visual Studio 2013中的IIS Express [英] Keeping web application attached to IIS Express in Visual Studio 2013

查看:56
本文介绍了将Web应用程序附加到Visual Studio 2013中的IIS Express的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio 2012中,如果我停止调试,则Web应用程序将保持与IIS Express的连接,这样我就可以继续在浏览器中加载页面,而不必重新启动调试.与.NET Demon结合使用时,这对我来说确实非常好,因为我的应用程序会在每次更改后重新生成,并且我可以直接跳到浏览器以立即检查更改.

In Visual Studio 2012, if I stopped debugging, the web application would remain attached to IIS Express, such that I could continue loading pages in the browser without having to restart debugging. This worked really well for me in conjunction with .NET Demon, as my application would rebuild after every change and I could just jump over to the browser to check the changes instantly.

升级到Visual Studio 2013后,此行为不再存在.当您停止调试时,该应用程序将完全分离,从而浏览器将生成一条错误消息,指出无法找到服务器.我发现经常不得不一直启动和停止调试非常烦人.有人知道这是否就是2013年的样子,还是我在某处缺少什么?

After upgrading to Visual Studio 2013, this behavior no longer exists. When you stop debugging, the application is completely detached, such that the browser will generate a error saying that it cannot find the server. I'm finding it very annonying to constantly have to start and stop debugging all the time. Does anyone know if this is just the way it is with 2013, or if I'm missing something somewhere?

编辑

好的,这很奇怪.显然,对于设置为启动项目的任何问题(或者由于是调试开始的项目而成为启动项目),这都是一个问题.调试停止后,无论我在其上开始进行调试的项目还是被设置为启动项目的项目,都与IIS Express完全无关.任何其他项目仍然可用.而且,如果我将所有项目都设置为启动项目,则在停止调试后,将无法使用任何内容,并且IIS Express托盘图标将完全消失.也许这是Visual Studio 2013和/或IIS Express 8中的错误?

Okay, so this is pretty weird. Apparently, it's only an issue for whatever is set as the startup project (or is the startup project by virtue of being the one that debugging was started on). Whatever project I start debugging on, or that is set as the startup project, is completely unattached from IIS Express after debugging stops. Any other projects are still available. And, if I set all the projects as startup projects, then after stopping debugging, nothing is available and the IIS Express tray icon goes away completely. Perhaps this is a bug in Visual Studio 2013 and/or IIS Express 8?

推荐答案

最后偶然发现了答案.如果在项目属性中启用了启用编辑并继续",则在停止调试时,Visual Studio将终止IIS Express进程,但如果禁用它,则IIS Express将继续运行.

Finally stumbled upon the answer. If you have "Enable Edit and Continue" enabled in your project properties, when you stop debugging, Visual Studio will kill the IIS Express process, but if you disable it, IIS Express will continue running.

结果表明,在VS2012中,此设置的默认值为 off ,这就是为什么我认为这应该可行的原因,但是在VS2013中,默认设置更改为上.

Turns out, in VS2012, the default for this setting was off, which is why I sort of took for granted that this should just work, but in VS2013, the default was changed to on.

这篇关于将Web应用程序附加到Visual Studio 2013中的IIS Express的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆