سؤال

I read all the answers already posted here but none seems to solve. Elmah is working flawlessly even if I got those warnings. Also I got those errors when I launch debug (f5) in visual studio 2012. On build everything is fine.

Config section in web.config is straightforward so I really don't know how to solve it:

<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>
هل كانت مفيدة؟

المحلول

I think this error is related to the fact that you have selected SqlErrorLog as your errorLog type. Did you run the Elmah SQL Server DB Script in the database that your EvaConnection connectionString is configured for? If not, you will need to do this, so that the correct tables and stored procedures are created for Elamh to use when writing errors to the database.

If you are using a later version of SQL Server than 2005, please see the note in the ErrorLog Implementation - Enterprise-Level Relational Databases wiki page for a note about the ntext field type.

Update:

After paying more attention to the question. Found a relevant post on the ELMAH Google Group - Could not find schema information This is an issue that Visual Studio reports about the ELMAH config section because it does not have a supporting .xsd file. There is a file available that can be used to suppress this error/warning message in Visual Studio. Just following the instructions from Issue 239: Intellisense for web.config and external config files

نصائح أخرى

I had everything working and then out of the blue I got this error too.

Before you try any of the more complicated solutions to this problem:

  1. Restart your Visual Studio
  2. Clean the solution
  3. Build the solution again

That solved the problem for me. It does seem like something got cached (or crashed) in Visual Studio.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top