Hi,
i'm working with NHibernate and i did my own HttpModule where i manage the Hibernate Session. Since i tried to use the combobox in my website it's didn't work. It always raise this exception :
[TypeInitializationException: Une exception a été levée par l'initialiseur de type pour 'DevExpress.Web.ASPxClasses.Internal.ResourceManager'.]
DevExpress.Web.ASPxClasses.Internal.ResourceManager.ProcessRequest() +43
DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule.BeginRequestHandler(Object sender, EventArgs e) +31
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
But when i erase this in my web.config (line 101):
<add name="NHibernateSessionPerRequestModule" type="WebApplication.Code.NHibernateSessionPerRequestModule" />
It work perfectly.
Can you help me to figure out what is the problem because if it's work we gonna use your tools in ours company.
thanks a lot
François
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hi François:
We're working on this issue and will answer you as soon as possible. Please accept our apologies for the delay.
Thanks
Kate.
Hi François,
I've tried to reproduce the problem using the project you post, but failed.
I was unable to start the site without the data base referenced in the hibernate.cfg.xml file:
"System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"
If I comment all code blocks, working with the data base, I have the following error related to the Microsoft.Practices.EnterpriseLibrary.Common.dll:
Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
So, I've created a new simple web site - TestWebSite, containing ASPxComboBox, and added your NHibernateSessionPerRequestModule. However, I changed the Application_BeginRequest and Application_EndRequest methods.
Please take a look at the attached project.
Also, please provide us with your sample projet (with the data base backup), reproducing the problem.
See Also: 'DevExpress.Web.ASPxClasses.Internal.ResourceManager' threw an exception. An unhandled exception has occurred. The type initializer for 'DevExpress.Web.ASPxClasses.Internal.ResourceManager' threw an exception., DevExpress.Web.AspxClasses.Internal.ResourceManager, Upgraded to 9.3.3, at runtime receive Xheo licensing error
Thanks,
Serge D
Hi, thanks for the reply.
If you let the line :
<add name="NHibernateSessionPerRequestModule" type="WebApplication.Code.NHibernateSessionPerRequestModule" />
In the HttpModule section in the Web.config section and you start the web site with the F5 key, the exception you have seen, gonna be fire :
Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly
But this exception hide the real problem, the exception witn the enterpriselibrary it's because we don't use the good version of the dll your logging the real exception.
Check the stack in the error page and you gonna see the real exception behind the one with the enterprise library :
[TypeInitializationException: The type initializer for 'DevExpress.Web.ASPxClasses.Internal.ResourceManager' threw an exception.]
DevExpress.Web.ASPxClasses.Internal.ResourceManager.ProcessRequest() +0
DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule.BeginRequestHandler(Object sender, EventArgs e) +31
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
But if you erase the line :
<add name="NHibernateSessionPerRequestModule" type="WebApplication.Code.NHibernateSessionPerRequestModule" />
In the web.config file, the website gonna start correctly but don't click on anylink, it's sure it gonna bugg because de BD isn't there.
So there is some problem with my httpmodule "NHibernateSessionPerRequestModule" and yours, and i would like to know why they aren't compatible together.
You can work on the file i give you when i opened the issue.
thanks a lot !
François
Sorry error of typing :
Sorry there is some typing error :
But this exception hide the real problem, the exception witn the enterpriselibrary it's because we don't use the good version of the dll your logging the real exception.
The good one
But this exception hide the real problem, the exception with the enterpriselibrary it's because we don't use the good version of the dll logging and it's hide the real exception with the 'DevExpress.Web.ASPxClasses.Internal.ResourceManager'.
Hi François,
Thanks for the additional explanation of this problem.
It appears on my side even without using your module.
So, our http module iterates through all assemblies referenced (FindAllWebResources method) in the project and handles them - the GetCustomAttributes method is called (and so on). So when it tries to handle Microsoft.Practices.EnterpriseLibrary.ExceptionHandling assembly, the following exception is thrown: "Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common'…". The cause of this problem is that the public key token equals to null (see the screenshot). It raises the "TypeInitializationException: The type initializer for 'DevExpress.Web.ASPxClasses.Internal.ResourceManager' threw an exception." but its inner exception is "Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common'".
Thanks,
Serge D
Hi,
Just to be sure, in the email you said that you find the problem and you gonna work on it (the message below) but on the issue on your website, you seem to be saying that the problem is on my side because it's didn't find the right assembly. The problem is on my side or there is some problem with your DevExpress.Web.ASPxClasses and my Nhibernate httpmodule ?
Thanks a lot i appreciate your effort to help use !
Sorry if my english is very bad.
Fran?ois
Hi François,
The previous message was an automatic messages sent by our Support Center. It's posted when we set a bug report status to reproduced. Sorry for this confusion.
Actually, the problem, as I wrote in the previous posts, appears because our http module is unable to handle the Microsoft.Practices.EnterpriseLibrary.ExceptionHandling assembly because it can't find the right dependent assembly.
On our side, we fix this behavior in the following way - if our http module, while iterating through referenced assemblies, will find an assembly that it can't handle, it will omit this assembly.
This new behavior should resolve your problem. However, a better way is to use correct assemblies.
Thanks,
Serge D
Thanks a lot :-)
I'm working on my assemblies issue.
thanks again and we gonna buy your library !
Very good job guys ! Your services is amazing !