Asp.net

找不到元素“elmah”的架構資訊

  • July 24, 2015

我閱讀了這裡已經發布的所有答案,但似乎沒有一個可以解決。即使我收到這些警告,Elmah 的工作也完美無缺。當我在 Visual Studio 2012 中啟動調試 (f5) 時,我也遇到了這些錯誤。在建構時一切都很好。

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="1" />
   <errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="EvaConnection" />
   <!--<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data/ErrorLogs" />-->
   <!-- ELMAH class ErrorMailModule.cs has been modified to read config from AppSettings -->
   <errorMail from="dummy@dummy.com" to="dummy@dummy.com" subject="dummy" priority="High" async="true" smtpPort="25" smtpServer="dummy" useSsl="false" userName="dummy@dummy.com" password="dummy" noYsod="false" />
 </elmah>

我認為這個錯誤與您選擇 SqlErrorLog 作為您的 errorLog 類型有關。您是否在您的connectionString 配置的數據庫中執行了Elmah SQL Server DB 腳本?EvaConnection如果沒有,您將需要這樣做,以便為 Elamh 創建正確的表和儲存過程,以便在將錯誤寫入數據庫時使用。

如果您使用的 SQL Server 版本高於 2005,請參閱ErrorLog 實施 - 企業級關係數據庫wiki 頁面中的註釋以獲取有關ntext欄位類型的註釋。

更新:

多關注問題後。在 ELMAH Google Group 上找到相關文章- 找不到架構資訊這是 Visual Studio 報告的有關 ELMAH 配置部分的問題,因為它沒有支持的 .xsd 文件。有一個文件可用於在 Visual Studio 中抑制此錯誤/警告消息。只需按照問題 239 中的說明進行操作:用於 web.config 和外部配置文件的 Intellisense

引用自:https://stackoverflow.com/questions/13914086