Now you may want to get log4net working and turn on show-sql in nhibernate, which will write to log4net. This records all the slq statements generated by nhibernate and sent to the database.
John Davidson On Fri, Mar 5, 2010 at 5:25 PM, tqwhite <[email protected]> wrote: > Thanks Michael. I have done unblocking (and am mad that it doesn't > give me an opportunity to unblock enclosed directories; makes this > very error prone). > > I am here to announce that I have had SUCCESS!!!!! > > I am a little sad to say that I don't know why, but only a very, very > little. > > Here's what happened. > > After taking some time off for other activities, I wanted to make sure > that I had told the truth when I said I had exercised IIS7's trust > levels (I knew I had, but, what the heck). So, I did them again. I > started with Minimal and, one by one, worked my way back up to High. > At the low levels, it complained that I had debugging turned on. At > High, it gave me a security exception. I set it back to Full without > looking at another error message. > > Then, I was reading something that told me that the reason I had my > properties set to "virtual" is that this supports lazy loading. Since > you've kindly told me that lazy loading does proxies and proxies > appear to be related to my problem (can't remember why I think this), > I thought, Screw those "virtual" declarations and removed them. This > got me an error message explaining that they were necessary. > > I replaced them and retested. The error message was "Invalid > object." !!!!!!! > > I'm start cursing in my head. I figure that I had somewhere made a > typo while thrashing around and I have absolutely no idea where it > could be. The worst possible situation. > > So, I start to debug. I look for typos in the files I can remember > touching today (not too many because I'm stuck with nHibernate). > Nothing wrong. I start googling the error, nothing. > > I grab the entire error message and view it in a browser so I can read > it properly. Damned if the error is not from nHibernate. It's from > sql, "SqlException (0x80131904): Invalid object name." I get excited. > If it's getting to sql, then it's opening nHibernate objects. > > Something suggests table mapping problems. Sure enough, my table and > class names don't match. I add a table attribute to the mapping file. > No joy. > > But, having gone through the investigation to figure out how > nHibernate knows table names, I thought, How the heck does it know the > Database name? > > I had simply copied my connection string out of a VIsual Studio > connection's property, so I had not really paid attention to it. Sure > as heck, the Initial Catalog was set to a different database!! > > Changed, tested, Eureka!!! > > Strictly speaking, I suppose, I don't know that nHibernate is working > (so I may be back), but it is no longer crashing. Neither the trust > experiments or the removing and replacing the virtual server should > have changed anything. It doesn't really matter. > > All of you folks that so patiently explained things to me, I can't > thank you enough. I would do it personally if I could, but I have to > ask you each to buy yourself a tasty cocktail this weekend and pretend > that I am raising a glass in your honor. > > tqii > > > > > > > On Mar 5, 3:06 pm, "Michael A. Bell" <[email protected]> > wrote: > > I'm jumping into this a little late so I have missed some of the previous > posts, but if you did not build this via the source and just downloaded the > assemblies themselves, you might need to check the file properties on the > assemblies and make sure that in the bottom right corner the Unblock button > does not exist. > > > > If it does, this may be why you are receiving this error. This is a > windows security feature since vista for files that are downloaded from the > web and could potentially be harmful, like exes, dlls and other scripts. > Try clicking the Unblock button and see if that fixes it for you. I have > run into a similar issue before and that did the trick. I have also seen > cases where you click the unblock button in the file properties and it still > does not unblock the file. If that is the case for you my only suggestion > to get you up and on your feet would be to build the source yourself. > > > > Mike > > > > > > > > -----Original Message----- > > From: [email protected] [mailto:[email protected]] On > Behalf Of tqwhite > > Sent: Friday, March 05, 2010 3:58 PM > > To: nhusers > > Subject: [nhusers] Re: But it IS an embedded resource and sometimes I > build it Twice!! Plus, Security Exception, arrgh > > > > Also, I note that the system complained that I had not included a > > reference to Lin Fu but did not complain that I had not provided a > > reference to Castle, even though I see Castle in the same directory > > (for lazy loading) as Lin Fu. > > > > Any meaning to that? > > > > tqii > > > > On Mar 5, 10:28 am, John Davidson <[email protected]> wrote: > > > the link below shows how to change trust levels in IIS7 > > > > >http://technet.microsoft.com/en-us/library/cc753658(WS.10).aspx<http://technet.microsoft.com/en-us/library/cc753658%28WS.10%29.aspx> > > > > > John Davidson > > > > > On Fri, Mar 5, 2010 at 9:50 AM, Richard Wilde <[email protected]> > wrote: > > > > >I remain lost on the Security Exception but, thanks again for your > > > > >help. > > > > >tqii > > > > > > From an earlier email I seem to recall that you put <trust > level="Medium" > > > > ... /> in your web.config. > > > > This is going to cause you problems with NH, lazy loading and maybe > several > > > > other things, so I would take this out of the web.config > > > > > > If you are going to deploy the application on a shared environment > that > > > > uses > > > > Medium Trust then obviously you will need the trust level. However I > don't > > > > think NH likes this too much! > > > > > > Rippo > > > > > > -- > > > > You received this message because you are subscribed to the Google > Groups > > > > "nhusers" group. > > > > To post to this group, send email to [email protected]. > > > > To unsubscribe from this group, send email to > > > > [email protected]<nhusers%[email protected]> > <nhusers%[email protected]<nhusers%[email protected]>> > > > > . > > > > For more options, visit this group at > > > >http://groups.google.com/group/nhusers?hl=en. > > > > -- > > You received this message because you are subscribed to the Google Groups > "nhusers" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > [email protected]<nhusers%[email protected]> > . > > For more options, visit this group athttp:// > groups.google.com/group/nhusers?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
