Error in web.config file Using Enterprise Library 4.1

Topics: User Discussion
Sep 29, 2011 at 11:03 PM
Edited Sep 29, 2011 at 11:10 PM

Hi

 I am trying to use SQL Server Data Access Application Block from above Library.

I have used "Enterprise Library Configuration" console to configure data access block and saved the config file as web.config.

I created a web application with Visual Studio 2008 with .Net 3.5 framework .

 I referenced following 4 dlls from above library

1)Microsoft.Practices.EnterpriseLibrary.Common.dl

2)Microsoft.Practices.EnterpriseLibrary.Data.dll

)Microsoft.Practices.ObjectBuilder2.dll

4)Microsoft.Practices.Unity.dll

I have portions of web.config file as follows:

<configSections >

<configuration

<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" >

 

<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />

<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" > <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />

 <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />

< section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />

 <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/></sectionGroup >

<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

sectionGroup >  

<sectionGroup >

 </configSections >

<dataConfiguration defaultDatabase="AdventureWorksConnectionString" />

 <connectionStrings > add name="AdventureWorksConnectionString" connectionString="Server=dev1;Integrated Security=SSPI" providerName="System.Data.SqlClient" /> connectionStrings >

  

While compiling this application I get follwoing error:-

Could not find schema information for the element 'dataConfiguration'.
Could not find schema information for the attribute 'defaultDatabase'.
Unrecognized configuration section dataConfiguration. 
Could not find schema information for the element 'dataConfiguration'. 
Could not find schema information for the attribute 'defaultDatabase'

I tried various steps but without any success.

Can anyone please help me in correcting web.config file?

Thank you in advance.

Bharat Gadhia

Coordinator
Oct 29, 2011 at 6:59 AM

Hi Bharat,

those messages seems to be only warnings about VS not finding the schemas for those sections. The schemas are only required if you want intellisence to work. That shouldn't affect your app.

Cheers,

Jeremi

Oct 29, 2011 at 5:30 PM

Hi Jeremi,

Thank you very much for reply.

I was able to sort out this issue.

Thanks once again.

Bharat,