Hi,
I opened my project today and added an ADOO.net data model. It seems
to have made a few changes in my web.config which have made my
application stop working. One of these changes is the message I am
getting, that says:
Warning 1 The element 'sectionGroup' cannot contain text. List of
possible elements expected: 'section, sectionGroup'. C:\inetpub\wwwroot
\web.config 17 13 C:\inetpub\wwwroot\
Message 2 Could not find schema information for the element 'elmah'. C:
\inetpub\wwwroot\web.config 19 3 C:\inetpub\wwwroot\
Message 3 Could not find schema information for the element
'errorLog'. C:\inetpub\wwwroot\web.config 66 4 C:\inetpub\wwwroot\
Message 4 Could not find schema information for the attribute 'type'.
C:\inetpub\wwwroot\web.config 66 13 C:\inetpub\wwwroot\
Message 5 Could not find schema information for the attribute
'logPath'. C:\inetpub\wwwroot\web.config 66 49 C:\inetpub\wwwroot\
Warning 6 C:\inetpub\wwwroot\Account\Member\AddSeries.aspx:
ASP.NET
runtime error: Unrecognized element. (C:\inetpub\wwwroot\web.config
line 17) C:\inetpub\wwwroot\Account\Member\AddSeries.aspx 1 1 C:
\inetpub\wwwroot\
Error 7 Unrecognized element. C:\inetpub\wwwroot\web.config 16
Except the one about the .aspx file, the rest are about Elmah. I have
tried adding the reference again (I went to the bin folder and added
it through there) but it still doesn't work. The configuration file is
below. Thanks for any help.
<?xml version="1.0"?>
<!--
For more information on how to configure your
ASP.NET application,
please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<sectionGroup name="elmah">
<!-- NOTE! If you are using
ASP.NET 1.x then remove the
requirePermission="false" attribute from the section
elements below as those are only needed for
partially trusted applications in
ASP.NET 2.0 -->
<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>
<!--
Use to log errors to Microsoft SQL Server 2000 or 2005
using
ASP.NET 2.0. Set value of connectionStringName
attribute
to the name of the connection string settings to use from
the <connectionStrings> section.
<errorLog type="Elmah.SqlErrorLog, Elmah"
connectionStringName="elmah" />
-->
<!--
Use to log errors to Microsoft SQL Server 2000 or 2005
using
ASP.NET 1.x and adjust the value of
connectionString
attribute to your settings.
<errorLog type="Elmah.SqlErrorLog, Elmah"
connectionString="Data Source=.;Initial
Catalog=ELMAH;Trusted_Connection=True" />
-->
<!--
Use to log errors to SQLite using
ASP.NET 2.0.
Set value of connectionStringName attribute to
the name of the connection string settings to
use from the <connectionStrings> section.
<errorLog type="Elmah.SQLiteErrorLog, Elmah"
connectionStringName="..." />
The format of the connection string should be as follows:
<connectionStrings>
<add name="..." connectionString="data source=[path to the
database file]" />
</connectionStrings>
Replace the content of the brackets with a file name, for
example:
data source=C:\Elmah.db
If the database file doesn't exist it is created
automatically.
To specify a path relative to and below the application
root,
start with the root operator (~) followed by a forward
slash (/),
as it is common in
ASP.NET applications. For example:
data source=~/App_Data/Error.db
-->
<!--
Use to log errors into separate XML files that are stored
on
disk at the path specified in the logPath attribute.
-->
<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data/
elmah" />
<!--
Use to log errors to Oracle
using
ASP.NET 2.0. Set value of connectionStringName
attribute
to the name of the connection string settings to use from
the <connectionStrings> section.
The schemaOwner parameter is *optional*. Use this if the
owner of the
ELMAH package (pkg_elmah$error) is not the same user that
you are
using to connect to the database.
<errorLog type="Elmah.OracleErrorLog, Elmah"
schemaOwner="xxx" />
connectionStringName="..." />
-->
<!--
Use to log errors to Oracle
using
ASP.NET 1.1 and adjust the value of
connectionString
attribute to your settings.
The schemaOwner parameter is *optional*. Use this if the
owner of the
ELMAH package (pkg_elmah$error) is not the same user that
you are
using to connect to the database.
<errorLog type="Elmah.OracleErrorLog, Elmah"
schemaOwner="xxx" />
connectionString="Data Source=xxxx;User
ID=username;Password=password" />
-->
<!--
Use to log errors to Microsoft Access
using
ASP.NET 1.x and adjust the value of
connectionString
attribute to your settings.
Use Elmah.mdb as your database.
<errorLog type="Elmah.AccessErrorLog, Elmah"
connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=|DataDirectory|Elmah.mdb" />
-->
<!--
Use to log errors to Microsoft Access
using
ASP.NET 2.0. Set value of connectionStringName
attribute
to the name of the connection string settings to use from
the <connectionStrings> section.
Use Elmah.mdb as your database.
<errorLog type="Elmah.AccessErrorLog, Elmah"
connectionStringName="..." />
-->
<!--
Use to log errors to VistaDB Express
using
ASP.NET 2.0. Set value of connectionStringName
attribute
to the name of the connection string settings to use from
the <connectionStrings> section.
<errorLog type="Elmah.VistaDBErrorLog, Elmah"
connectionStringName="..." />
The format of the connection string should be as follows:
<connectionStrings>
<add name="..." connectionString="Data Source='[path to the
database file]';Open Mode=NonExclusiveReadWrite;Pooling=True"
providerName="VistaDB.Provider" />
</connectionStrings>
Replace the content of the brackets with a file name, for
example:
Data Source='C:\Elmah.vdb3'
If the database file doesn't exist it is created
automatically.
To specify a path relative to and below the application
root,
start with the root operator (~) followed by a forward
slash (/),
as it is common in
ASP.NET applications. For example:
Data Source='~/App_Data/Error.vdb3'
You can also specify the App_Data directory using the
|DataDirectory| macro. For example:
Data Source='|DataDirectory|\Elmah.vdb3'
Note the use of the Open Mode and Pooling parameters
-->
<!--
Use to send error reports by e-mail and adjust the
attributes
according to settings desired. Note that only the from and
to attributes are required. The rest are optional and may
be removed. If the SMTP server does not require
authentication,
you MUST remove the userName and password attributes or
set them to empty values (resulting in zero-length
strings).
If you are using ELMAH compiled for .NET Framework 1.x,
then
the to attribute may contain multiple recipient addresses,
each of which must be delimited by a semi-colon(;). If you
are
using ELMAH compiled for .NET Framework 2.0 or later, then
the
to attribute may contain multiple recipient addresses,
each of which must be delimited by a comma (,).
<errorMail
from="
el...@example.com"
to="
ad...@example.com"
subject="..."
priority="Low|Normal|High"
async="true|false"
smtpPort="25"
smtpServer="
smtp.example.com"
useSsl="true|false"
userName="johndoe"
password="secret"
noYsod="true|false" />
-->
<!--
Use to send short error messages to a twitter account.
<errorTweet
userName="johndoe"
password="secret" />
-->
<!--
Use to prevent errors from being mailed or logged based on
assertions. An assertion evaluates the current context,
resulting
in a Boolean outcome. An error is filtered if the
assertion results
in true. For a more detailed explanation, see:
http://code.google.com/p/elmah/wiki/ErrorFiltering
The example below will filter errors when any of the
following conditions occur:
- The status code is set to 404
- The root/base cause is System.IO.FileNotFoundException
- The root/base cause is
System.Web.HttpRequestValidationException
- The user agent making the request identifies itself as
"crawler"
- The request is from the local machine
The assertion below is expressed as a JScript expression
and is the
most generic and simplest of the assertions to use if you
are
familiar with the JavaScript language. It can work in
Medium and
Full trust environments.
<errorFilter>
<test>
<jscript>
<expression>
<![CDATA[
// @assembly mscorlib
// @assembly System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// @import System.IO
// @import System.Web
HttpStatusCode == 404
|| BaseException instanceof FileNotFoundException
|| BaseException instanceof
HttpRequestValidationException
/* Using RegExp below (see
http://msdn.microsoft.com/en-us/library/h6e2eb7w.aspx) */
|| Context.Request.UserAgent.match(/crawler/
i)
|| Context.Request.ServerVariables['REMOTE_ADDR']
== '127.0.0.1' // IPv4 only
]]>
</expression>
</jscript>
</test>
</errorFilter>
-->
</elmah>
<system.web>
<httpModules>
<!--
Uncomment the entry below if all of the following are
true:
1) you are using wildcard mapping in IIS 5.x
2) you are not using .Net 1.0
3) you are experiencing http 404 errors when trying to
view
elmah.axd or elmah.axd/detail?id=* etc
-->
<!--<add name="FixIIS5xWildcardMapping"
type="Elmah.FixIIS5xWildcardMappingModule, Elmah"/>-->
<!--
Uncomment the entry below if you are using MS Ajax
v1.0.x.x
and want to capture errors during Partial Postbacks
NB This is not required for the version of Ajax
shipped with .Net Framework v3.5!
-->
<!--<add name="MsAjaxDeltaErrorLog"
type="Elmah.MsAjaxDeltaErrorLogModule, Elmah"/>-->
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
<!--
Uncomment the entries below if error mail reporting
and filtering is desired.
-->
<!--<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" /
>-->
<!--<add name="ErrorFilter" type="Elmah.ErrorFilterModule,
Elmah"/>-->
<!--<add name="ErrorTweet" type="Elmah.ErrorTweetModule, Elmah"/
>-->
</httpModules>
<httpHandlers>
<!--
This entry provides the UI for the error log at
elmah.axd below the application path. For example,
if your domain is
www.example.com and your application
is at the root, then you can view the error log by
visiting the following URL:
http://www.example.com/elmah.axd
IMPORTANT! To secure this location, consult the
following notes:
http://code.google.com/p/elmah/wiki/SecuringErrorLogPages
-->
<add verb="POST,GET,HEAD" path="elmah.axd"
type="Elmah.ErrorLogPageFactory, Elmah" />
</httpHandlers>
<compilation debug="false">
<assemblies>
<add assembly="System.Security, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Data.Entity, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Data.Entity.Design, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=B77A5C561934E089" />
</assemblies>
<buildProviders>
<add extension=".edmx"
type="System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider" />
</buildProviders>
</compilation>
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" />
</authentication>
<siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
<providers>
<add name="XmlSiteMapProvider" description="Default SiteMap
provider." type="System.Web.XmlSiteMapProvider "
siteMapFile="Web.sitemap" securityTrimmingEnabled="true" />
</providers>
</siteMap>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="ApplicationServices"
enablePasswordRetrieval="false" enablePasswordReset="true"
requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6"
minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
applicationName="/" />
</providers>
</membership>
<profile>
<providers>
<clear />
<add name="AspNetSqlProfileProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="ApplicationServices" applicationName="/" />
</providers>
</profile>
<roleManager enabled="true">
<providers>
<clear />
<add connectionStringName="ApplicationServices"
applicationName="/" name="AspNetSqlRoleProvider"
type="System.Web.Security.SqlRoleProvider" />
<add applicationName="/" name="AspNetWindowsTokenRoleProvider"
type="System.Web.Security.WindowsTokenRoleProvider" />
</providers>
</roleManager>
</system.web>
<connectionStrings>
<add name="ApplicationServices" connectionString="data source=.
\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|
\aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
<add name="BlindMovieBuff" connectionString="Data Source=.
\SQLEXPRESS;Initial Catalog=BlindMovieBuff;Integrated
Security=True;Pooling=false" providerName="System.Data.SqlClient" />
<add name="BlindMovieBuffEntities"
connectionString="metadata=res://*/App_Code.Model.csdl|res://*/
App_Code.Model.ssdl|res://*/
App_Code.Model.msl;provider=System.Data.SqlClient;provider connection
string="Data Source=parham1\SQLEXPRESS;Initial
Catalog=BlindMovieBuff;Integrated
Security=True;Pooling=False;MultipleActiveResultSets=True""
providerName="System.Data.EntityClient" />
</connectionStrings>
<!--
The <system.webServer> section is required for running ELMAH
under Internet
Information Services 7.0. It is not necessary for previous
version of IIS.
In general, it would be best to include it for all .NET
Framework 2.0 and above
configurations in order to have a more portable solution
between various
versions of IIS.
IIS 5.x, IIS 6 require the modules and handlers to be declared
in <system.web>
whereas IIS 7 needs them declared here and complains if they
are in fact
declared in <system.web>. Fortunately, the
<validation validateIntegratedModeConfiguration="false" />
entry tells IIS 7
not to worry about the modules and handlers declared in
<system.web>.
If you only ever want to use IIS 7, then do the following:
1. Remove handlers and modules from <system.web>
2. Remove the <validation
validateIntegratedModeConfiguration="false" /> element
-->
<!--
The following entry denies unauthenticated users access to
the path from where ELMAH's handlers are accessible. If you
have role-based security implemented, you SHOULD consider
instead allowing access by a particular role (for example,
operators and administrators).
IMPORTANT: If you change the path of the handler above
then you MUST also change the path in the location tag below
to be the same.
For more information, see:
http://code.google.com/p/elmah/wiki/SecuringErrorLogPages
-->
<location path="elmah.axd">
<system.web>
<authorization>
<allow roles="Admin" />
<deny users="?" />
</authorization>
</system.web>
</location>
<system.webServer>
<!-- <modules runAllManagedModulesForAllRequests="true"/> -->
<validation validateIntegratedModeConfiguration="false" />
<modules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"
preCondition="managedHandler" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"
preCondition="managedHandler" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"
preCondition="managedHandler" />
<add name="ErrorTweet" type="Elmah.ErrorTweetModule, Elmah"
preCondition="managedHandler" />
</modules>
<handlers>
<add name="Elmah" path="elmah.axd" verb="POST,GET,HEAD"
type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" /
>
</handlers>
</system.webServer>
</configuration>
Thanks!