Results 1 to 11 of 11

Thread: [RESOLVED] The requested page cannot be accessed because the related configuration data for the

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Location
    India, Kerala, Calicut
    Posts
    242

    Resolved [RESOLVED] The requested page cannot be accessed because the related configuration data for the

    Am trying to run my asp.ent web application and it shows the following error

    "The requested page cannot be accessed because the related configuration data for the page is invalid."

    and in Config Error it says " The configuration section 'hibernate-configuration' cannot be read because it is missing a section declaration"
    in web.config file i have the following code

    Code:
    <configSections>
        <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
        <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
      </configSections>
    
      <!-- NHibernate Settings-->
      <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
        <session-factory>
          <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
          <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>
          <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
          <property name="connection.connection_string">Server=localhost;initial catalog=UserMaintenance;Trusted_Connection=True</property>
          <property name="show_sql">false</property>
          <property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>
          <property name="current_session_context_class">managed_web</property>
          <property name="adonet.batch_size">20</property>
          <property name="cache.provider_class">NHibernate.Cache.HashtableCacheProvider</property>
          <property name="cache.use_query_cache">true</property>
          <property name="default_schema">UserMaintenance.dbo</property>
          <property name="connection.isolation">ReadCommitted</property>
        </session-factory>
      </hibernate-configuration>
    Please help me..

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: The requested page cannot be accessed because the related configuration data for

    If you are going to add custom sections to your config file then you have to tell the Framework about them in the <configSections> element. You have an example there for Entity Framework so you'll need something similar for NHibernate. You'll be able to find examples online.

    By the way, if you're not using EF then you should get rid of that EF custom section declaration.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Location
    India, Kerala, Calicut
    Posts
    242

    Re: The requested page cannot be accessed because the related configuration data for

    now i added the following section in config sections
    Code:
        <section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate"/>
    and now its showing error in global.asax file
    its saying the following error
    Code:
    Could not load file or assembly 'NHibernate, Version=2.1.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The system cannot find the file specified.
    in the following section
    Code:
     ManagedWebSessionContext.Bind( HttpContext.Current, WigleSessionManager.SessionFactory.OpenSession());
    
            }

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: The requested page cannot be accessed because the related configuration data for

    Well, is that assembly available? If not then that would explain why it failed to load.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Location
    India, Kerala, Calicut
    Posts
    242

    Re: The requested page cannot be accessed because the related configuration data for

    yes that assembly is available.

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: The requested page cannot be accessed because the related configuration data for

    Where is it located?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Location
    India, Kerala, Calicut
    Posts
    242

    Re: The requested page cannot be accessed because the related configuration data for

    in bin folder of my project

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: The requested page cannot be accessed because the related configuration data for

    And you get that error message when you run the project in the debugger?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Location
    India, Kerala, Calicut
    Posts
    242

    Re: The requested page cannot be accessed because the related configuration data for

    yeah

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Location
    India, Kerala, Calicut
    Posts
    242

    Re: The requested page cannot be accessed because the related configuration data for

    Sorry. Earlier i said those files located in projects bin folder. Its not.
    its in the following location

    C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Location
    India, Kerala, Calicut
    Posts
    242

    Re: The requested page cannot be accessed because the related configuration data for

    It is solved. I have put the assemblies in project's bin folder )

    Thank u all

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width