×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

IIS 5 web applications initialization is not guaranteed

本文发表在 rolia.net 枫下论坛Hi there,

I have a weird problem with a web application in IIS 5 environment.

When an ASP is invoked from a browser, the web application should do
some server-side initialization work (calling Application_OnStart()
in global.asa).

But on this machine, this doesn't *ALWAYS* happen.
I write a pair of testing pages and install it as a seperate web
application in the same virtual web site. The same things happen again.

The testing pages source codes are as follows,

global.asa
==========
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
Application("testVar") = "abc"
End Sub
</SCRIPT>

test.asp
========
<%@ Language=VBScript %>
<html>
<body>
<p>Application("testVar")="<%=Application("testVar")%>"</p>
</body>
</html>

I invoked the page using http://localhost/testweb/test.asp
The screen displayed:
Application("testVar")="abc"
Then I unloaded the test application from IIS console and refresh the
screen, the value become empty (""):
Application("testVar")=""

I tried several unloadings and refreshings, some times it showed the
value, some times didn't.
I also changed the Application Protection between "Medium (Pooled)"
and "High (Isolated)", it didn't help either.

Please note that the same applications including the testing one work
fine on several single-cpu workstations (Windows 2000 Professional
and Windows 2000 Server with the same service pack level).

This machine's configuration is as follows,
Windows 2000 Server, build 2195, Service Pack 3;
Four way SMP, 2.5 GB memory;

Is there any special configuration on the server or any other software
installed there that could prevent the intialization?

Regards更多精彩文章及讨论,请光临枫下论坛 rolia.net
Report

Replies, comments and Discussions:

  • 工作学习 / IT技术讨论 / IIS 5 web applications initialization is not guaranteed
    本文发表在 rolia.net 枫下论坛Hi there,

    I have a weird problem with a web application in IIS 5 environment.

    When an ASP is invoked from a browser, the web application should do
    some server-side initialization work (calling Application_OnStart()
    in global.asa).

    But on this machine, this doesn't *ALWAYS* happen.
    I write a pair of testing pages and install it as a seperate web
    application in the same virtual web site. The same things happen again.

    The testing pages source codes are as follows,

    global.asa
    ==========
    <SCRIPT LANGUAGE=VBScript RUNAT=Server>
    Sub Application_OnStart
    Application("testVar") = "abc"
    End Sub
    </SCRIPT>

    test.asp
    ========
    <%@ Language=VBScript %>
    <html>
    <body>
    <p>Application("testVar")="<%=Application("testVar")%>"</p>
    </body>
    </html>

    I invoked the page using http://localhost/testweb/test.asp
    The screen displayed:
    Application("testVar")="abc"
    Then I unloaded the test application from IIS console and refresh the
    screen, the value become empty (""):
    Application("testVar")=""

    I tried several unloadings and refreshings, some times it showed the
    value, some times didn't.
    I also changed the Application Protection between "Medium (Pooled)"
    and "High (Isolated)", it didn't help either.

    Please note that the same applications including the testing one work
    fine on several single-cpu workstations (Windows 2000 Professional
    and Windows 2000 Server with the same service pack level).

    This machine's configuration is as follows,
    Windows 2000 Server, build 2195, Service Pack 3;
    Four way SMP, 2.5 GB memory;

    Is there any special configuration on the server or any other software
    installed there that could prevent the intialization?

    Regards更多精彩文章及讨论,请光临枫下论坛 rolia.net
    • try restart IIS web server every time when loading the new changes in global.asa
    • What did you do to "unloaded the test application" ?