[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..
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.
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());
}
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.
Re: The requested page cannot be accessed because the related configuration data for
yes that assembly is available.
Re: The requested page cannot be accessed because the related configuration data for
Re: The requested page cannot be accessed because the related configuration data for
in bin folder of my project
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?
Re: The requested page cannot be accessed because the related configuration data for
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
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