If you can find time and way to send the issue somewhere in MS would be useful. Probably that is only a no tested case (instead call it a bug).
2010/1/24 Sam Kimmel <[email protected]> > I apologize, Fabio, I misunderstood. That is one thing I hate about > electronic communications--it can be read in many ways depending on the mood > of the reader [and this morning I was tired and cranky from staying up past > 2 am for the 5th straight night]. I didn't even think back to the context > of the original message, "Operation could destabilize the runtime." Yeah, > it is hard to beleive that such a subtle change could have an impact on the > stability of the runtime. But take a look at the other things people were > reporting > (http://forums.asp.net/p/981415/1255521.aspx)<http://forums.asp.net/p/981415/1255521.aspx>... > kind of ridiculous. > > I'll document my process and post things to JIRA as I find them and fix > them. > > > On Sat, Jan 23, 2010 at 9:38 PM, Fabio Maulo <[email protected]> wrote: > >> No Sam, no... what I'm saying is that somebody in MS had the brilliant >> idea to define something like >> return validatorDef.Tags == null || validatorDef.Tags.Count == 0 ? new >> object[] {null} : validatorDef.Tags; >> as a "destabilization" where >> if ( validatorDef.Tags == null || validatorDef.Tags.Count == 0) >> return new object[] {null}; >> return validatorDef.Tags; >> should be not a destabilization. >> >> IMO only God can know why that code is something "destabilizing" a >> machine. >> Thanks for your investigation and please add a JIRA ticket with anything >> needed for NHV. >> >> 2010/1/23 Sam Kimmel <[email protected]> >> >>> They are essentially the same code, so I don't know why there is a >>> difference. This is the only coding change I've had to make in any of the >>> assemblies; the rest I just had to add the AllowPartiallyTrustedCallers >>> attribute to and recompile. If you're inferring that I am destabilizing the >>> coding of NHibernate and Castle, I'm open to suggestions for alternate ways >>> to get things to work in Medium Trust [aside from sticking to NH 2.0.1 and >>> the associated assemblies that are distributed with the ProxyGenerator :-) >>> ]. Would adding a strong name to my projects make a difference? I did what >>> I thought was signing them with a strong name in Visual Studio, but that >>> didn't seem to change anything. >>> >>> I'd love having everything work for medium trust out of the box by only >>> having to set an XML configuration flag. But a member of the Castle team >>> stated in their user group that they will not release an out of the box >>> version of Core or DynamicProxy with the APTCA for security reasons; plus, >>> based on the posts from people having problems with Medium Trust going back >>> to 2005-2006, while there has been some effort in trying to help them there >>> doesn't seem to be much concern. >>> >>> I've done some testing in Full Trust while working through the Manning >>> book and the Summer of NHibernate tutorials and have seen the great >>> potential of NHibernate; so I'm doing my best to try and figure out MT using >>> the latest assemblies. If people aren't interested I'll stop posting >>> questions and updates. >>> >>> >>> >>> On Sat, Jan 23, 2010 at 4:28 PM, Fabio Maulo <[email protected]>wrote: >>> >>>> such destabilization..... >>>> >>>> 2010/1/23 Sam Kimmel <[email protected]> >>>> >>>> Okay, I was able to fix this error by modifying the code in >>>>> NHibernate.Validator slightly. I was reading some forum discussions on >>>>> the "Operation could destabilize the runtime" errors and found that >>>>> some code (usually targeted at ASP.Net 1.1, or compiled with a >>>>> different compiler) sometimes trips up the the compiler. Since the >>>>> error was hapening in >>>>> InvalidMessageTransformer.GetEfectiveValidatorMatchTags, that is where >>>>> I went to look for the problem. The fix turned out to be quite >>>>> simple: >>>>> >>>>> Change from this: >>>>> >>>>> private ICollection<object> GetEfectiveValidatorMatchTags() >>>>> { >>>>> return validatorDef.Tags == null || validatorDef.Tags.Count == 0 >>>>> ? >>>>> new object[] {null} : validatorDef.Tags; >>>>> } >>>>> >>>>> To this: >>>>> >>>>> private ICollection<object> GetEfectiveValidatorMatchTags() >>>>> { >>>>> if ( validatorDef.Tags == null || validatorDef.Tags.Count == 0) >>>>> return new object[] {null}; >>>>> return validatorDef.Tags; >>>>> } >>>>> >>>>> >>>>> On Jan 23, 2:21 am, Sam Kimmel <[email protected]> wrote: >>>>> > I currently have 3 tiers to my application: >>>>> > >>>>> > 1) Entities (decorated with NHV attributes) >>>>> > 2) Data (Contains my session manager and Data access objects. >>>>> > Validate objects prior to save/update in the DAOs.) >>>>> > 3) Web (Calls data access objects to get/save/update entities) >>>>> > >>>>> > The error below gets thrown when I attempt to validate my entity. >>>>> Does >>>>> > the error give any ideas as to what is going on? >>>>> > >>>>> > Server Error in '/' Application. >>>>> > >>>>> -------------------------------------------------------------------------------- >>>>> > >>>>> > Operation could destabilize the runtime. >>>>> > Description: An unhandled exception occurred during the execution of >>>>> > the current web request. Please review the stack trace for more >>>>> > information about the error and where it originated in the code. >>>>> > >>>>> > Exception Details: System.Security.VerificationException: Operation >>>>> > could destabilize the runtime. >>>>> > >>>>> > Source Error: >>>>> > >>>>> > An unhandled exception was generated during the execution of the >>>>> > current web request. Information regarding the origin and location of >>>>> > the exception can be identified using the exception stack trace >>>>> > below. >>>>> > >>>>> > Stack Trace: >>>>> > >>>>> > [VerificationException: Operation could destabilize the runtime.] >>>>> > >>>>> > >>>>> NHibernate.Validator.Engine.InvalidMessageTransformer.GetEfectiveValidatorMatchTags >>>>> > () +64 >>>>> > NHibernate.Validator.Engine.InvalidMessageTransformer.GetMatchTags >>>>> > () +28 >>>>> > >>>>> > NHibernate.Validator.Engine.InvalidMessageTransformer.<Transform>b__4 >>>>> > (<>f__AnonymousTypec`2 <>h__TransparentIdentifier1) +70 >>>>> > System.Linq.<>c__DisplayClass12`3.<CombineSelectors>b__11(TSource >>>>> > x) +32 >>>>> > System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +184 >>>>> > System.Linq.<SelectManyIterator>d__31`3.MoveNext() +273 >>>>> > System.Linq.<ConcatIterator>d__71`1.MoveNext() +309 >>>>> > System.Linq.<ConcatIterator>d__71`1.MoveNext() +128 >>>>> > System.Linq.<ConcatIterator>d__71`1.MoveNext() +309 >>>>> > System.Linq.Buffer`1..ctor(IEnumerable`1 source) +259 >>>>> > System.Linq.Enumerable.ToArray(IEnumerable`1 source) +81 >>>>> > NHibernate.Validator.Engine.ValidatorEngine.Validate(Object >>>>> entity, >>>>> > Object[] activeTags) +23 >>>>> > Tectonic.Data.SessionManager.Validate(Object entity) +34 >>>>> > Tectonic.Data.UserDao.Save(User u) +48 >>>>> > Tectonic.Web._Default.btnCreate_Click(Object sender, EventArgs e) >>>>> > +296 >>>>> > System.EventHandler.Invoke(Object sender, EventArgs e) +0 >>>>> > System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111 >>>>> > System.Web.UI.WebControls.Button.RaisePostBackEvent(String >>>>> > eventArgument) +110 >>>>> > >>>>> > >>>>> System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent >>>>> > (String eventArgument) +10 >>>>> > System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler >>>>> > sourceControl, String eventArgument) +13 >>>>> > System.Web.UI.Page.RaisePostBackEvent(NameValueCollection >>>>> postData) >>>>> > +36 >>>>> > System.Web.UI.Page.ProcessRequestMain(Boolean >>>>> > includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) >>>>> > +1565 >>>>> >>>>> -- >>>>> 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. >>>>> >>>>> >>>> >>>> >>>> -- >>>> Fabio Maulo >>>> >>>> >>>> -- >>>> 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]<nhusers%[email protected]> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/nhusers?hl=en. >>> >> >> >> >> -- >> Fabio Maulo >> >> -- >> 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]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > -- Fabio Maulo -- 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.
