在ASP.NET WebForms中通过HTTPS远程访问elmah.axd时出现"禁止"错误

rse*_*nna 3 asp.net iis-6 webforms elmah .net-2.0

我正在尝试将ELMAH集成到webforms应用程序中.由于我不允许更改的原因,必须仅通过HTTPS访问整个应用程序.

该应用程序正在运行,但我们无法远程访问ELMAH的日志文件.我已遵循说明,以便允许远程访问但没有成功.

这是生产web.config文件中当前的相关配置:

<configuration>
    <configSections>
        <sectionGroup name="elmah">
            <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
            <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
            <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
            <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
        </sectionGroup>
    </configSections>
    <elmah>
        <security allowRemoteAccess="yes" requirePermission="false" />
        <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" />
    </elmah>

    <system.web>

        <httpModules>
            <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
        </httpModules>
        <httpHandlers>
            <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
        </httpHandlers>
Run Code Online (Sandbox Code Playgroud)

还有什么我可以做的吗?有人知道通过HTTPS访问ELMAH的日志文件是否存在某种限制?

请注意,我们目前正在使用IIS 6.0和.NET framework 2.0.

小智 10

解决方案:在配置文件中:将0更改为1

<security allowRemoteAccess="0" />
Run Code Online (Sandbox Code Playgroud)

<security allowRemoteAccess="1" />
Run Code Online (Sandbox Code Playgroud)

这就像一个魅力.

请享用!!

  • 我从未使用过`<security allowRemoteAccess ="0"/>`.我的配置文件有这一行:`<security allowRemoteAccess ="yes"requirePermission ="false"/>`."是"和"1"都被接受. (2认同)