IISReset做了什么?

时间:2008-08-22 21:37:36

标签: asp.net iis iis-6

在IIS 6上,IIS重置有什么作用?

请与回收应用程序池以及停止和启动ASP.NET网站进行比较。

如果更换DLL或编辑/替换ASP.NET网站上的web.config与停止和启动该网站相同吗?

10 个答案:

答案 0 :(得分:77)

IISReset停止并重新启动整个Web服务器(包括非ASP.NET应用程序)
回收应用程序池只会影响在该应用程序池中运行的应用程序 在Web应用程序中编辑web.config只会影响该Web应用程序(仅回收该应用程序) 编辑计算机上的machine.config将回收所有正在运行的应用程序池。

IIS将监视应用程序的/ bin目录。每当在这些dll中检测到更改时,它将回收应用程序并重新加载这些新dll。它还监视web.config& machine.config以相同的方式执行,并为适用的应用程序执行相同的操作。

答案 1 :(得分:28)

IISReset重新启动整个Web服务器(包括所有关联的站点)。如果您只是想重置一个ASP.NET网站,那么您应该只回收该AppDomain。

重置ASP.NET网站的最常用方法是编辑web.config文件,但您也可以创建一个包含以下内容的管理页面:

public partial class Recycle : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpRuntime.UnloadAppDomain();
    }
}

这是我写的一篇博文,其中包含更多信息:Avoid IISRESET in ASP.NET Applications

答案 2 :(得分:23)

它在整个IIS进程树上运行,而不仅仅是您的应用程序池。

C:\>iisreset /?

IISRESET.EXE (c) Microsoft Corp. 1998-1999

Usage:
iisreset [computername]

    /RESTART            Stop and then restart all Internet services.
    /START              Start all Internet services.
    /STOP               Stop all Internet services.
    /REBOOT             Reboot the computer.
    /REBOOTONERROR      Reboot the computer if an error occurs when starting,
                        stopping, or restarting Internet services.
    /NOFORCE            Do not forcefully terminate Internet services if
                        attempting to stop them gracefully fails.
    /TIMEOUT:val        Specify the timeout value ( in seconds ) to wait for
                        a successful stop of Internet services. On expiration
                        of this timeout the computer can be rebooted if
                        the /REBOOTONERROR parameter is specified.
                        The default value is 20s for restart, 60s for stop,
                        and 0s for reboot.
    /STATUS             Display the status of all Internet services.
    /ENABLE             Enable restarting of Internet Services
                        on the local system.
    /DISABLE            Disable restarting of Internet Services
                        on the local system.

答案 3 :(得分:5)

应用程序池回收会重新启动该应用程序池的 w3wp.exe进程,因此它只会影响在该应用程序池中运行的网站。

IISReset重新启动所有w3wp.exe进程和任何其他IIS相关服务,即NNTP或FTP服务。

我认为更改web.config/bin不会回收整个应用程序池,但我不确定。

答案 4 :(得分:2)

它会停止并启动IIS所包含的服务。

您可以将其视为关闭相关程序并重新启动。

答案 5 :(得分:1)

当您更改ASP.NET网站的配置文件时,它会重新启动应用程序以反映更改...

执行IIS重置时,会重新启动在该IIS实例上运行的所有应用程序。

答案 6 :(得分:1)

编辑web.config文件或更新bin文件夹中的DLL只会回收该应用程序的工作进程,而不是整个池。

答案 7 :(得分:1)

这是technet对iisreset

所说的内容
  

在某些配置更改生效或应用程序不可用之前,您可能需要重新启动Internet Information Services(IIS)。重新启动IIS与首先停止IIS,然后再次启动IIS相同,只不过它是通过一个命令完成的。

答案 8 :(得分:1)

您可以找到有关哪些服务影响on the Microsoft docs的更多信息。

答案 9 :(得分:1)

IISReset重新启动整个Web服务器(包括所有关联的站点)。如果您只是想重置一个ASP.NET网站,则应该只回收该应用程序域。