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

时间:2021-02-25 03:35:26

During development, I usually test ASP.Net applications using the Web Development Server (sometimes called Cassini). Occasionally, when I publish to a real IIS environment, I notice that the application behaves differently.

在开发过程中,我通常使用Web Development Server(有时称为Cassini)测试ASP.Net应用程序。有时,当我发布到真正的IIS环境时,我注意到应用程序的行为有所不同。

So, what are the differences between the way that production IIS servers and the ASP.Net Web Development Server behave? 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服务器和ASP.Net Web开发服务器的行为方式有何不同?我并不是说功能集的差异(显然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.

顺便说一句:对这个问题的回答中提到了一些差异,但我确信必须有更多。

2 个解决方案

#1


0  

Some differences might be:

一些差异可能是:

  • You can't use virtual directories while working with cassini. This might lead to unexpected behaviour when deploying for the first time, due to missing folder permissions. (e.g. You have a /image/ directory on your local machine, but in the IIS /image/ is the virtual directory pointing elsehwere)
  • 使用cassini时,不能使用虚拟目录。由于缺少文件夹权限,这可能会在第一次部署时导致意外行为。 (例如,您的本地计算机上有/ image /目录,但在IIS / image /中是指向elsehwere的虚拟目录)
  • Some third party assemblies (like ComponenArt Web DLL) cause problems with specific port issues. It's best to develop with the IIS to minimize compability problems on deploying.
  • 某些第三方程序集(如ComponenArt Web DLL)会导致特定端口问题出现问题。最好使用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。

#2


4  

Some things I have picked up here and elsewhere:

我在这里和其他地方采取的一些事情:

  • The security context in which the respective servers run ASP.NET apps is different. For the Dev Server, this is the current user's account. For IIS, this is the context of the special user (ASPNET or NETWORK SERVICES) that typically has limited privileges.

    各个服务器运行ASP.NET应用程序的安全上下文是不同的。对于Dev Server,这是当前用户的帐户。对于IIS,这是特殊用户(ASPNET或NETWORK SERVICES)的上下文,通常具有有限的权限。

  • For a Web Site, the Development Server subjects static files (images and style sheets etc)to ASP.NET authorization. However, IIS serves static files without using authorization rules.

    对于Web站点,Development Server使静态文件(图像和样式表等)受到ASP.NET授权。但是,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。

#1


0  

Some differences might be:

一些差异可能是:

  • You can't use virtual directories while working with cassini. This might lead to unexpected behaviour when deploying for the first time, due to missing folder permissions. (e.g. You have a /image/ directory on your local machine, but in the IIS /image/ is the virtual directory pointing elsehwere)
  • 使用cassini时,不能使用虚拟目录。由于缺少文件夹权限,这可能会在第一次部署时导致意外行为。 (例如,您的本地计算机上有/ image /目录,但在IIS / image /中是指向elsehwere的虚拟目录)
  • Some third party assemblies (like ComponenArt Web DLL) cause problems with specific port issues. It's best to develop with the IIS to minimize compability problems on deploying.
  • 某些第三方程序集(如ComponenArt Web DLL)会导致特定端口问题出现问题。最好使用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。

#2


4  

Some things I have picked up here and elsewhere:

我在这里和其他地方采取的一些事情:

  • The security context in which the respective servers run ASP.NET apps is different. For the Dev Server, this is the current user's account. For IIS, this is the context of the special user (ASPNET or NETWORK SERVICES) that typically has limited privileges.

    各个服务器运行ASP.NET应用程序的安全上下文是不同的。对于Dev Server,这是当前用户的帐户。对于IIS,这是特殊用户(ASPNET或NETWORK SERVICES)的上下文,通常具有有限的权限。

  • For a Web Site, the Development Server subjects static files (images and style sheets etc)to ASP.NET authorization. However, IIS serves static files without using authorization rules.

    对于Web站点,Development Server使静态文件(图像和样式表等)受到ASP.NET授权。但是,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。