не может получить доступ к Элме через URL - PullRequest
0 голосов
/ 18 февраля 2019

Я установил elmah в свое приложение.URL моего приложения localhost: 53245 / Default.aspx и после добавления elmah будет выглядеть так: localhost: 53245 / Default.aspx / elmah.axd.это не работает .он остается на той же странице по умолчанию.Мой проект в структуре MVP.Пожалуйста, помогите.

web.config

      <?xml version="1.0" encoding="utf-8"?>
      <configuration>
      <configSections>
      <section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" />
      <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>
      <enterpriseLibrary.ConfigurationSource selectedSource="File Configuration Source">
      <sources>
      <add name="File Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" filePath="Entlib.config" />
      </sources>
      </enterpriseLibrary.ConfigurationSource>

      <appSettings>

      </appSettings>
      <system.net>

      </system.net>
      <system.web>
      <authentication mode="Windows" />
      <customErrors mode="Off" defaultRedirect="~/ErrorsView.aspx" redirectMode="ResponseRewrite" />
      </controls>
      </pages>
      <httpHandlers>

      </httpHandlers>
      <httpModules>

      <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" /><add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" /><add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" /></httpModules>
      </system.web>
      <system.codedom>
      <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <providerOption name="CompilerVersion" value="v4.0" />
      <providerOption name="WarnAsError" value="false" />
      </compiler>
      </compilers>
      </system.codedom>
      <system.serviceModel>
      <bindings>
      <basicHttpBinding>
      <binding name="BasicHttpBinding_IWsdsService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" useDefaultWebProxy="true" />
      </basicHttpBinding>
      </bindings>
      <client>
      <endpoint address="http://localhost:6949/hfjfjfjf.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWsdsService" contract="WsdsService.IWsdsService" name="BasicHttpBinding_IWsdsService" />
      </client>

      </system.serviceModel>
      <system.webServer>

      <modules>
      <remove name="ScriptModule" />
      <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
     <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" /><add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" /><add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" /></modules>
     <handlers>
     <remove name="WebServiceHandlerFactory-Integrated" />
     <remove name="ScriptHandlerFactory" />
     <remove name="ScriptHandlerFactoryAppServices" />
     <remove name="ScriptResource" />
     <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
     <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
     <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
     </handlers>
     <httpErrors errorMode="Detailed" />
     <asp appAllowClientDebug="false" appAllowDebugging="false" enableParentPaths="true" scriptErrorSentToBrowser="false" bufferingOn="true" />
     <validation validateIntegratedModeConfiguration="false" />
 </system.webServer>
     <runtime>
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
     <dependentAssembly>
     <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
     <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
     </dependentAssembly>
     <dependentAssembly>
     <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
     <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
     </dependentAssembly>
     <dependentAssembly>
     <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="3a9cab8f8d22bfb7" culture="neutral" />
     <bindingRedirect oldVersion="0.0.0.0-3.1.3.42154" newVersion="3.1.3.42154" />
     </dependentAssembly>
     <dependentAssembly>
     <assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral" />
     <bindingRedirect oldVersion="0.0.0.0-3.3.1.4000" newVersion="3.3.1.4000" />
     </dependentAssembly>
     <dependentAssembly>
     <assemblyIdentity name="Microsoft.Practices.Unity" publicKeyToken="31BF3856AD364E35" culture="neutral" />
     <bindingRedirect oldVersion="0.0.0.0-2.0.414.0" newVersion="2.1.505.0" />
     </dependentAssembly>
     <dependentAssembly>
     <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" culture="neutral" />
     <bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
     </dependentAssembly>
     </assemblyBinding>
     </runtime>


 <location path="elmah.axd" inheritInChildApplications="false">
     <system.web>
     <httpHandlers>
     <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
     </httpHandlers>
     <!-- 
     See http://code.google.com/p/elmah/wiki/SecuringErrorLogPages for 
     more information on using ASP.NET authorization securing ELMAH.
     -->
     <authorization>
     <allow roles="Administration" />
     <deny users="*" />  
     </authorization>

     </system.web>
     <system.webServer>
     <handlers>
     <add name="ELMAH" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
     </handlers>
     </system.webServer>
 <elmah>
      <!--
        See http://code.google.com/p/elmah/wiki/SecuringErrorLogPages for 
        more information on remote access and securing ELMAH.
      -->
      <security allowRemoteAccess="1" />
      <errorLog type="Elmah.XmlFilerErrorLog, Elmah"     logPath="~/App_Data/elmahlogs" />
      </elmah>
     </location>
    </configuration>

Как я могу решить эту проблему.Я установил страницу default.aspx как страницу по умолчанию.

1 Ответ

0 голосов
/ 18 февраля 2019

Elamah должен быть доступен из корня сайта, а не через страницу по умолчанию.

localhost:53245/elmah.axd
...