首页 / 知识

关于asp.net:“IISReset”有什么作用?

2023-04-12 23:15:00

关于asp.net:“IISReset”有什么作用?

What does 'IISReset' do?

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

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

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


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

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


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

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

1
2
3
4
5
6
7
public partial class Recycle : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpRuntime.UnloadAppDomain();
    }
}

这是我写的更多信息的博客文章:在ASP.NET应用程序中避免IISRESET


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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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.

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

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

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


它停止并启动IIS组成的服务。

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


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


您可以在Microsoft文档上找到有关它影响哪些服务的更多信息。


这是Technet关于iisreset不得不说的话

You might need to restart Internet Information Services (IIS) before certain configuration changes take effect or when applications become unavailable. Restarting IIS is the same as first stopping IIS, and then starting it again, except it is accomplished with a single command.


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


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

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


作用网站替换启动

最新内容

相关内容

热门文章

推荐文章

标签云

猜你喜欢