Strange exception "Cannot set the ConfigurationCache property after calling Init"

49 views
Skip to first unread message

Kenny Evitt

unread,
Sep 19, 2013, 1:07:53 PM9/19/13
to sharp-arc...@googlegroups.com
The exception is being generated by the code on line 59 of the S#arp Architecture file d:\Builds\SharpArch2\Solutions\SharpArch.NHibernate\NHibernateSession.cs. Here's the source for that file in GitHub.

The app code that's apparently indirectly generating the exception is the following (in my app's Global.asax.cs file):

            NHibernateSession.ConfigurationCache = new NHibernateConfigurationFileCache();

There's a Stack Overflow question for the same apparent issue, and the person that asked that question also posted a topic in this group (almost two years ago), but the only resolution offered was to comment out the above line.

My app is using multiple databases and it's using a custom session storage class, but what's particularly 'strange' is that neither of those are new. The app is running fine on my local dev computer and in IIS on a dev server. The exception first occurred (immediately?) after deploying to the production server earlier today.

Does anyone have any ideas about how this can be resolved?



I just re-deployed the latest build to the production server and now I'm getting a different error:

"Could not find a getter for property 'BlahBlahBlahId' in class 'Apps.Domain.Something'"



Is there something that needs to be done to 'invalidate' any existing cached configurations when a new version of the app is deployed (if there are changes to the domain entity classes)?

Kenny Evitt

unread,
Sep 19, 2013, 1:12:26 PM9/19/13
to sharp-arc...@googlegroups.com
I found the S#arp Architecture wiki page about the configuration cache and I think I know what the problem is – the cache is being created without any assembly dependencies, hence it isn't being invalidated as it should.

Kenny Evitt

unread,
Sep 19, 2013, 1:27:32 PM9/19/13
to sharp-arc...@googlegroups.com
[The "Could not find a getter for properpty ..." exception was promptly followed by the original exception.]



Based on the few examples of using the configuration cache, I couldn't figure out exactly how it needs to be constructed with the appropriate dependencies.

I was, however, able to resolve the error, by removing the serialized configuration cache files (from C:\Windows\Temp) and then restarting the site and recycling the app pool in IIS.

Seif Attar

unread,
Sep 19, 2013, 3:41:44 PM9/19/13
to sharp-arc...@googlegroups.com
Glad you got it sorted.


--
You received this message because you are subscribed to the Google Groups "S#arp Architecture" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sharp-architect...@googlegroups.com.
To post to this group, send email to sharp-arc...@googlegroups.com.
Visit this group at http://groups.google.com/group/sharp-architecture.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages