【问题标题】:Can't add sessionState to web.config without Error 500.19无法在没有错误 500.19 的情况下将 sessionState 添加到 web.config
【发布时间】:2011-02-02 10:53:48
【问题描述】:

我正在使用经典 ASP 创建一个新的 Web 应用程序。我以前做过,并且有 2 个类似的网站已经运行了 2 年以上。我的问题是我使用的 ISP 将我托管在运行 Server 2008、IIS7 的系统上,我不能依赖会话状态保持不变。我使用会话变量在页面之间传递经过验证的用户名。我知道我可以重写应用程序以使用 db 存储作为替代方案,但我讨厌不得不修改工作应用程序。

在与 ISP 交谈时,他们建议将 sessionState 变量添加到我的 web.config 文件中,并使用 stateserver 将数据传递到他们系统上的文件(他们提供了连接字符串等)。这看起来不错,但是每当我将 sessionState 行添加到 web.config 时,网站都会收到错误 500.19,错误代码为 0x8007000d。

我试图在我的本地 PC 上添加一行来简单地更改会话超时作为测试方法,但我得到了同样的错误。我确定这很明显,但是我已经研究了一般主题,看起来应该可以吗?简单的 web.config 代码如下,任何建议都将不胜感激(我正在前额上开发一个平坦的点,以免撞到桌子)。 谢谢,

web.config 的内容

<?xml version="1.0" encoding="UTF-8"?>
<configuration>

<system.webServer>

<sessionState timeout="40" />

        <defaultDocument enabled="true">
            <files>
                <clear />
                <add value="index.aspx" />
                <add value="index.asp" />
                <add value="default.htm" />
                <add value="default.html" />
            </files>
        </defaultDocument>
        <security>
            <authentication>
                <basicAuthentication enabled="true" />
            </authentication>
        </security>
        <httpErrors errorMode="Custom">
            <remove statusCode="404" subStatusCode="-1" />
            <error statusCode="404" prefixLanguageFilePath="" path="/OaOInternal/DefaultWebs/sedoCurrent/Error404.aspx" responseMode="ExecuteURL" />
        </httpErrors>
    </system.webServer>
</configuration>

【问题讨论】:

    标签: asp-classic web-config


    【解决方案1】:

    经典的 ASP 网站不使用 web.config 文件

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多