Appendix B error Unrecognized configuration section profile
Hi
I think I have found the answer to the problem below but will leave the post here for others. I checked the machine.config file and saw that the <profile> was in the sectionGroup <sytem.web> so moved the code down the page to under <system.web> and the site is running again.
I am trying to modify the web.config file so that the Application Services use my own SQLServer database instead of aspnetdb.mdf as per the code on page 704 of Appendix B.
I think that I have successully used aspnet_regsql to configure the database in that 11 new tables in the form aspnet_Applications etc have appeared in my database.
However, when I save the web.config file with the code on page 704 added or try to run any of my existing pages, I get the error "Error 42 Unrecognized configuration section profile." on line 29 of web.config which is the first line of code on page 704.
Maybe is is something to do with where I have placed the code on the web.config page which is immediately after this code below or maybe I need to add something else in the page or another page or do I have a typo......
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensions SectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGro up, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptReso urceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebService sSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerial izationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
<section name="profileService" type="System.Web.Configuration.ScriptingProfileSer viceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthentica tionServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServic eSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<!-- start of inserted code from page 704 of Beginning ASP.NET 3.5 book -->
<profile> this is line 29
<providers>
<clear/>
<add
type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
name="AspNetSqlProfileProvider"
connectionStringName="HotSearchConnectionString"
applicationName="/"
/>
</providers>
<properties>
<add name="FirstName"/>
<add name="LastName"/>
</properties>
</profile>
<roleManager enabled="true">
<providers>
<clear />
<add
type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
name="AspNetSqlRoleProvider"
connectionStringName="HotSearchConnectionString"
applicationName="/"
/>
</providers>
</roleManager>
<membership>
<providers>
<clear/>
<add
type="System.Web.Security.SQLMembershipProvider, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
name="AspNetSqlMembershipProvider"
connectionStringName="HotSearchConnectionString"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
applicationName="/"
requiresUniqueEmail="false"
passwordFormat="hash"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="8"
passwordAttemptWindow="10"
passwordStrengthRegularExpression=""
/>
</providers>
</membership>
<!-- end of inserted code from page 704 of Beginning ASP.NET 3.5 book -->
<appSettings/>
Thank you for your help.
David
Last edited by davidh08; August 19th, 2009 at 12:40 AM..
|