简体   繁体   English

IIS和ASP.Net Web开发服务器之间的行为差​​异?

[英]Differences in behaviour between IIS and the ASP.Net Web Development Server?

During development, I usually test ASP.Net applications using the Web Development Server (sometimes called Cassini). 在开发过程中,我通常使用Web Development Server(有时称为Cassini)测试ASP.Net应用程序。 Occasionally, when I publish to a real IIS environment, I notice that the application behaves differently. 有时,当我发布到真正的IIS环境时,我注意到应用程序的行为有所不同。

So, what are the differences between the way that production IIS servers and the ASP.Net Web Development Server behave? 那么,生产IIS服务器和ASP.Net Web开发服务器的行为方式有何不同? I don't mean differences in feature sets (clearly IIS has lots of features that are not present in WDS), but differences in the way they handle ASP.Net. 我并不是说功能集的差异(显然IIS有许多WDS中没有的功能),但它们处理ASP.Net的方式不同。

BTW: There are a few differences noted in the responses to this question , but I am sure there must be more. 顺便说一句:对这个问题的回答中提到了一些差异,但我确信必须有更多。

Some things I have picked up here and elsewhere: 我在这里和其他地方采取的一些事情:

  • The security context in which the respective servers run ASP.NET apps is different. 各个服务器运行ASP.NET应用程序的安全上下文是不同的。 For the Dev Server, this is the current user's account. 对于Dev Server,这是当前用户的帐户。 For IIS, this is the context of the special user (ASPNET or NETWORK SERVICES) that typically has limited privileges. 对于IIS,这是特殊用户(ASPNET或NETWORK SERVICES)的上下文,通常具有有限的权限。

  • For a Web Site, the Development Server subjects static files (images and style sheets etc)to ASP.NET authorization. 对于Web站点,Development Server使静态文件(图像和样式表等)受到ASP.NET授权。 However, IIS serves static files without using authorization rules. 但是,IIS提供静态文件而不使用授权规则。

  • The Development Server doesn't support SMTP, so you can't send emails directly from this server. 开发服务器不支持SMTP,因此您无法直接从此服务器发送电子邮件。

  • The Development Server doesn't support HTTPS. 开发服务器不支持HTTPS。

  • There is a difference in the way the two servers handle paths that contain "//". 两个服务器处理包含“//”的路径的方式不同。 The Dev server is reportedly being more forgiving. 据报道,Dev服务器更加宽容。

  • The Dev server randomly chosen port rather than the standard HTTP port 80. Dev服务器随机选择端口而不是标准HTTP端口80。

Some differences might be: 一些差异可能是:

  • You can't use virtual directories while working with cassini. 使用cassini时无法使用虚拟目录。 This might lead to unexpected behaviour when deploying for the first time, due to missing folder permissions. 由于缺少文件夹权限,这可能会在第一次部署时导致意外行为。 (eg You have a /image/ directory on your local machine, but in the IIS /image/ is the virtual directory pointing elsehwere) (例如,您在本地计算机上有/ image /目录,但在IIS / image /中是指向其他的虚拟目录)
  • Some third party assemblies (like ComponenArt Web DLL) cause problems with specific port issues. 某些第三方程序集(如ComponenArt Web DLL)会导致特定端口问题出现问题。 It's best to develop with the IIS to minimize compability problems on deploying. 最好使用IIS进行开发,以最大限度地减少部署时的兼容性问题。
  • The trustlevel of the target IIS might be lower that your development settings, this might result in malfunctioning, depending on what you do with the IIS, like reading the Uptime. 目标IIS的trustlevel可能低于您的开发设置,这可能会导致出现故障,具体取决于您使用IIS执行的操作,例如读取Uptime。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM