问题ELMAH在GAC [英] Problem with Elmah in the GAC

查看:105
本文介绍了问题ELMAH在GAC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图按照这篇文章:
HTTP://www.$c$cproject.com/KB/aspnet/elmahGAC的.aspx

I am attempting to follow this article: http://www.codeproject.com/KB/aspnet/elmahGAC.aspx

获得ELMAH从GAC工作而不需要为每个应用程序设置独立。一切正常,但在本地当设置全局设置,停止ELMAH记录。我读的地方,如果ELMAH从GAC运行,那么设置应该是全局的machine.config相较于全球性的web.config,但是我已经用尽全力。现在,我在一个点,如果我补充一点:

to get Elmah working from the GAC rather than needing to be setup for each application individually. Everything works locally but when the settings are set globally, Elmah stops logging. I read somewhere that if Elmah is running from the GAC then the settings should be in the "global" machine.config vs the "global" web.config but I've tried both. Right now, I'm at a point where if I add this:

<system.webServer>
<modules>
  <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah, Version=1.2.13605.0, Culture=neutral, PublicKeyToken=abc123" preCondition="managedHandler" />
</modules>
</system.webServer>

在我的应用程序的web.config,它拿起的设置,从全球machine.config中休息,并成功登录。要回答一个显而易见的问题,是我在全球machine.config中本节,并甚至试图在全球web.config中进入,但仍在记录将无法正常工作。任何人有什么想法?反正是有得到ELMAH,而不是显示失败悄悄其错误?

into my application's web.config, it picks up the rest of the settings from the global machine.config and logs successfully. To answer the obvious question, yes I have this section in the global machine.config and have even tried entering it in the global web.config but still logging won't work. Anyone have any ideas? Is there anyway to get Elmah to display its errors instead of failing quietly?

编辑:这是我的全局machine.config文件。这只是一个默认的工具和ELMAH增加,并采取了一些节组,以满足字符的限制。我也许应该也注意到这是在IIS7运行。

Here is my "global" machine.config file. It's just the default one with the stuff for ELMAH added and some section groups taken out to meet the char limit. I should probably also note this is running in IIS7.

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


<configSections>
    <sectionGroup name="elmah">
      <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah, Version=1.2.13605.0, Culture=neutral, PublicKeyToken=e50dbdd41da277ac" />
      <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah, Version=1.2.13605.0, Culture=neutral, PublicKeyToken=e50dbdd41da277ac" />
      <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah, Version=1.2.13605.0, Culture=neutral, PublicKeyToken=e50dbdd41da277ac" />
      <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah, Version=1.2.13605.0, Culture=neutral, PublicKeyToken=e50dbdd41da277ac" />
    </sectionGroup>
  </configSections>

<connectionStrings>
<clear />
<add name="Elmah.Sql"      connectionString="IMNOTTELLING" providerName="System.Data.SqlClient" />
<add name="LocalSqlServer" connectionString="IMNOTTELLING" providerName="System.Data.SqlClient" />
</connectionStrings>

<elmah>
  <security allowRemoteAccess="0" />
  <errorLog type="Elmah.SqlErrorLog, Elmah, Version=1.2.13605.0, Culture=neutral, PublicKeyToken=e50dbdd41da277ac" connectionStringName="Elmah.Sql" />      
</elmah>

<runtime />



<system.data>
    <DbProviderFactories />
</system.data>

<system.serviceModel>
Nothing tampered with here
</system.serviceModel>



<system.web>
    <processModel autoConfig="true"/>

  <httpHandlers>
    <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah, Version=1.2.13605.0, Culture=neutral, PublicKeyToken=e50dbdd41da277ac" />
  </httpHandlers>

  <httpModules>
    <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah, Version=1.2.13605.0, Culture=neutral, PublicKeyToken=e50dbdd41da277ac" />
    <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah, Version=1.2.13605.0, Culture=neutral, PublicKeyToken=e50dbdd41da277ac" />
    <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah, Version=1.2.13605.0, Culture=neutral, PublicKeyToken=e50dbdd41da277ac" />
  </httpModules>

  <compilation>
    <assemblies>
      <add assembly="Elmah, Version=1.2.13605.0, Culture=neutral, PublicKeyToken=e50dbdd41da277ac" />
    </assemblies>
  </compilation>

    <membership>
    Nothing tampered with here
    </membership>

    <profile>
        <providers>
            <add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="/"
                type="System.Web.Profile.SqlProfileProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        </providers>
    </profile>

    <roleManager>
        Nothing tampered with here
    </roleManager>
</system.web>


<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests ="true">
  <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah, Version=1.2.13605.0, Culture=neutral, PublicKeyToken=e50dbdd41da277ac" preCondition="managedHandler" />
  <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah, Version=1.2.13605.0, Culture=neutral, PublicKeyToken=e50dbdd41da277ac" preCondition="managedHandler" />
  <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah, Version=1.2.13605.0, Culture=neutral, PublicKeyToken=e50dbdd41da277ac" preCondition="managedHandler" />
</modules>
<handlers>
  <add name="Elmah" path="elmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah, Version=1.2.13605.0, Culture=neutral, PublicKeyToken=e50dbdd41da277ac" preCondition="integratedMode" />
</handlers>
</system.webServer>
</configuration>

编辑:我安装的模块和处理程序IIS直接现在的作品

I installed the modules and handler in IIS directly and now it works.

推荐答案

我也有一个Win7x64与IIS7安装的问题(测试生产系统)。我终于通过将模块与处理器连接到在的applicationHost.config 文件中的相应节点得到了这个工作。

I also had problems with IIS7 on a Win7x64 install (testing for a production system). I finally got this working by putting the module and handler into the appropriate nodes in the applicationHost.config file.

C:\\ WINDOWS \\ SYSTEM32 \\ INETSRV \\设置\\的applicationHost.config

似乎忽略IIS7主骨架的某些区域的web.config 的文件,而不是使用的applicationHost.config 文件IIS设置。

It seems that IIS7 ignores certain areas of the main framework web.config files, instead using the applicationHost.config file for IIS settings.

一些需要注意的有关文件,如果你是一个64位的安装:看来,32位应用程序(包括Visual Studio中),会出现看不到文件。这是因为一些文件系统行为由于操作系统为64位。一个简单的解决方法是使用UNC路径打开它:

Something to note about that file if you are on a 64 bit install: it seems that 32 bit applications (including Visual Studio) will appear to not see the file. It's because of some file system behavior due to the OS being 64 bit. One easy work around is to open it using an UNC path:

\\\\本地主机\\ C $ \\ WINDOWS \\ SYSTEM32 \\ INETSRV \\设置\\的applicationHost.config

这篇关于问题ELMAH在GAC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆