visual-studio 使用 Cassini 而不是 IIS 的(缺点)优势是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/103785/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What are the (dis)advantages of using Cassini instead of IIS?
提问by sebastiaan
I've found that on some occasions I can edit the source while debugging. Are there any other advantages of using the Visual Studio built-in webserver instead of a virtual directory in IIS?
我发现在某些情况下我可以在调试时编辑源代码。使用 Visual Studio 内置网络服务器而不是 IIS 中的虚拟目录还有其他优势吗?
I'm using Windows XP on my development environment, and a local instance of IIS 5. I work on several projects, so I use multiple virtual directories to manage all the different sites.
我在我的开发环境中使用 Windows XP,并使用 IIS 5 的本地实例。我处理多个项目,因此我使用多个虚拟目录来管理所有不同的站点。
Are there any disadvantages?
有什么缺点吗?
回答by pdavis
The built-in web server for Visual Studio is called Cassini and here are a few of its limitations...
Visual Studio 的内置 Web 服务器称为 Cassini,以下是它的一些限制...
- It can host only one ASP.NET application per port.
- It does not support HTTPS.
- It does not support authentication.
- It responds only to localhost requests.
- It is slow startup compared to IIS
- 每个端口只能承载一个 ASP.NET 应用程序。
- 它不支持 HTTPS。
- 它不支持身份验证。
- 它只响应本地主机请求。
- 与 IIS 相比,它的启动速度较慢
回答by Christopher G. Lewis
All the previous responses are great answers - here's one gottcha with Cassini that might require IIS on the destkop.
之前的所有回复都是很好的答案 - 这是 Cassini 的一个问题,它可能需要在 destkop 上安装 IIS。
Cassini runs in the context of the developer, not as the IIS user (IUSR_, IWAM, or in WinXP x64, the w3wp process). This can be a bit painful if you've got a web site that is accessing external files or creating temp files. It is most evident when your developer is running as an Admin of their desktop.
Cassini 在开发人员的上下文中运行,而不是作为 IIS 用户(IUSR_、IWAM 或在 WinXP x64 中的 w3wp 进程)。如果您有一个访问外部文件或创建临时文件的网站,这可能会有点痛苦。当您的开发人员以桌面管理员身份运行时,这一点最为明显。
When you move to the server IIS, something that you would have had access to in Cassini doesn't work the same. CACLing with the IIS_WPG usually is all it takes to fix, but if your developer is not thinking about this, they will quickly get quite frustrated with their deploy.
当您移动到服务器 IIS 时,您可以在 Cassini 中访问的某些内容无法正常工作。通常只需要使用 IIS_WPG 进行 CACL 即可修复,但是如果您的开发人员不考虑这一点,他们很快就会对他们的部署感到非常沮丧。
回答by John Sheehan
Cassini does not support virtual directories.
Cassini 不支持虚拟目录。
回答by Glen Little
回答by Glen Little
Another disadvantage I've run into is on a Forms authenticated website using custom IPrincipal/IIdentity. Cassini will switch the AppDomainswithout warning (or notice).
我遇到的另一个缺点是在使用自定义IPrincipal/的表单身份验证网站上IIdentity。卡西尼号将在AppDomains没有警告(或通知)的情况下切换。
Check this blog postfor more.The headache on this made me drop Cassini and stick with IIS.
查看此博客文章了解更多信息。对此的头痛让我放弃了 Cassini 并坚持使用 IIS。
回答by Simon_Weaver
The Visual Studio web server is less forgiving about //in the path.
Visual Studio Web 服务器//在路径中不太宽容。
It will refuse to serve a link like
http://localhost:52632/main//images/logo.jpgwhere IIS will do.
它将拒绝提供像http://localhost:52632/main//images/logo.jpgIIS那样的链接
。
That's pretty obscure, but it means we have a lot of fixing to do to get rid of all the //occurrences.
这很模糊,但这意味着我们有很多修复工作要做,以消除所有//发生的情况。
回答by Joel Coehoorn
The built-in server works well for larger corporations that don't want to give developers any administrator access on their own machines to configure IIS.
内置服务器非常适用于不想让开发人员在他们自己的机器上拥有任何管理员访问权限来配置 IIS 的大型公司。
回答by Greg Hurlman
There's a bug in the way the built-in server handles HTTPModules- there is a workaround, but I hate having to put in code that'll never be needed in production.
内置服务器处理 HTTPModules 的方式存在错误- 有一个解决方法,但我讨厌必须放入生产中永远不需要的代码。
回答by Simon_Weaver
You need to have Visual Studio running to use it (under normal circumstances)
It only responds to localhost, so you can't give the link
http://simon-laptop:37473/app1to a friend to view your site over the networkBig disadvantage: it's harder to get fiddlerworking, because localhost traffic isn't sent through the proxy.
您需要运行 Visual Studio 才能使用它(正常情况下)
它只响应本地主机,因此您不能将链接
http://simon-laptop:37473/app1提供给朋友以通过网络查看您的站点大缺点:让fiddler工作更难,因为 localhost 流量不是通过代理发送的。
Using http://ipv4.fiddler:37473is the best way to get Fiddler working with it.
使用http://ipv4.fiddler:37473是让 Fiddler使用它的最佳方式。
回答by Gilligan
Cassini also does not support ASP Classicpages. This is only an issue for legacy projects where old ASP Classic pages still exist (like our web application at work).
Cassini 也不支持ASP Classic页面。这只是旧的 ASP Classic 页面仍然存在的遗留项目的问题(比如我们工作中的 web 应用程序)。

