English 中文(简体)
Reset IIS on ASP. 发生错误时的网络站点
原标题:Reset IIS on ASP.NET site when an error occurres

i 设有一个伙伴关系。 NET网站,在某些非常少见的场合有错误,造成许多失败的请求。 错误在OnError凌驾于我所有页基类别之上,即错误发生时。

由于这一错误非常少见,因此,如果发生错误,则希望重新确定错误,以便该地点恢复正常运转。

my question: on the OnError code below, how can i cause the IIS to reset? i can run iisreset or can cause the iis to crash using something like System.Environment.Exit(-1). what is there a preferred method to reset the iis?

    Protected Overrides Sub OnError(ByVal e As EventArgs)
        LogException(Server.GetLastError())
        MyBase.OnError(e)
    End Sub
最佳回答

首先,正如其他人指出的那样,你需要重新启动伙伴关系。 NET应用软件,而不是IIS(网络服务器)。 实现这一目标有两个途径

  1. To touch (modify) web.config (similar alternative is to touch/modify bin folder)
  2. To ask AppDomain to unload (using HttpRuntime.UnloadAppDomain)

>,第条讨论这一办法。

我也建议你考虑将使用期的回收利用(从IIS配置中可以找到)作为替代办法。 a

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签