Invalid section name. The section 'dataConfiguration' does not exist in the requested configuration file

Jul 31, 2008 at 9:18 PM
Hey Guys,

So it looks like a lot of people have posted about this problem, but none of the solutions I've seen have resolved it. I am using enterprise library 4.0 and vb.net 3.5. My config file looks like this:

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

<dataConfiguration defaultDatabase="sttConTrack" />

<connectionStrings>
         <add name="sttConTrack" connectionString="DataSource = WDBSSDBBGDERV03; InitialCatalog = sttConTrack; UserId =*****; Password =*******"
           providerName="System.Data.SqlClient" />
</connectionStrings>

I would really appreciate some help.

THANKS
Jul 31, 2008 at 10:43 PM
Hi,

The snippet itself looks fine, so without more context is hard to help. Is it possible this configuration snippets belongs to the configuration file for a dll instead of an exe or a web app? Is there an exception involved? If there is, what are its message and stack trace? Are you referencing the signed 4.0 binaries in your application?

Regards,
Fernando
Aug 1, 2008 at 2:41 PM
>Is it possible this configuration snippets belongs to the configuration file for a dll instead of an exe or a web app?
No, its for an executable.

>Is there an exception involved? If there is, what are its message and stack trace?
Yes.

Message: Invalid section name. The section 'dataConfiguration' does not exist in the requested configuration file 'C:\Development\Hess\MR\STT\FilenetTransmitService\Code\Hess.MR.STT.FilenetTransmitService.Console\bin\Debug\Hess.MR.STT.FilenetTransmitService.Console.vshost.exe.Config' or the file 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config'. Make sure that the 'enterpriseLibrary.configurationSections' configuration section exists in one of the files and that the section 'dataConfiguration' is defined.

Stack Trace:    at Microsoft.Practices.EnterpriseLibrary.Configuration.ConfigurationBuilder.ValidateSection(String sectionName)    at Microsoft.Practices.EnterpriseLibrary.Configuration.ConfigurationBuilder.ReadConfiguration(String sectionName)    at Microsoft.Practices.EnterpriseLibrary.Configuration.ConfigurationContext.GetConfiguration(String sectionName)    at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConfigurationView.GetDatabaseSettings()    at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConfigurationView.GetDatabaseProviderData(String instanceName)    at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseProviderFactory.GetConfigurationType(String instanceName)    at Microsoft.Practices.EnterpriseLibrary.Configuration.ConfigurationFactory.CreateInstance(String configurationName)    at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseProviderFactory.CreateDatabase(String instanceName)    at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseFactory.CreateDatabase(String instanceName)    at Hess.MR.STT.FilenetTransmitService.Data.DataAccessBase..ctor() in C:\Development\Hess\MR\STT\FilenetTransmitService\Code\Hess.MR.STT.FilenetTransmitService.Data\Base Classes\DataAccessBase.vb:line 27    at Hess.MR.STT.FilenetTransmitService.Data.DataAccess..ctor()    at Hess.MR.STT.FilenetTransmitService.Business.TrackingHistoryBase.TransmitHistoryGetRows() in C:\Development\Hess\MR\STT\FilenetTransmitService\Code\Hess.MR.STT.FilenetTransmitService.Business\Base Classes\TrackingHistoryBase.vb:line 167    at Hess.MR.STT.FilenetTransmitService.Business.FilenetTransmissionService.CompareFileNames() in C:\Development\Hess\MR\STT\FilenetTransmitService\Code\Hess.MR.STT.FilenetTransmitService.Business\FilenetTransmissionService.vb:line 18    at Hess.MR.STT.FilenetTransmitService.Console.Module1.Main() in C:\Development\Hess\MR\STT\FilenetTransmitService\Code\Hess.MR.STT.FilenetTransmitService.Console\Module1.vb:line 7    at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)    at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)    at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)    at System.Threading.ThreadHelper.ThreadStart()

>Are you referencing the signed 4.0 binaries in your application?

I am pretty sure. I am referencing the dll's in the bin folder of enterprise library

Thanks a lot
Aug 1, 2008 at 4:43 PM
Hi,

The stack you've posted belongs to the v1.x version of the DAAB. Can yo please check the version numbers in the assemblies you're using?

The configuration schema changed radically in v2 to use the new System.Configuration features available with .NET 2.0.

Regards,
Fernando