Thread: [Quickfix-users] "Cannot pass a GCHandle across AppDomains" Problem
Brought to you by:
orenmnero
From: Hamza K. <h.k...@gm...> - 2009-08-18 14:38:25
|
Greetings, I have built a Web application [Initiator] on IIS using MS .Net framework with QuickFix libraries versions 1.0.2447.42059 & 1.0.3512.29706, but when I try to start the initiator, I am getting this error below: * **Cannot pass a GCHandle across AppDomains. Parameter name: handle Source="mscorlib" ParamName="handle" StackTrace: at System.Runtime.InteropServices.GCHandle.InternalCheckDomain(IntPtr handle) at System.Runtime.InteropServices.GCHandle.FromIntPtr(IntPtr value) at System.Runtime.InteropServices.GCHandle.op_Explicit(IntPtr value) at gcroot<QuickFix::Log ^>.->(gcroot<QuickFix::Log ^>* ) at Log.onEvent(Log* , basic_string<char\,std::char_traits<char>\,std::allocator<char> >* string)* Please note that I have written the same code in a Windows application, and everything is working fine - only the problem is occurring in the Web application. And I have tried also using multi-threading, but the problem still persists. Do you know anything about this problem. Thank you. Best Regards, Hamza A. Kamaleddine Software Developer & Analyst Netiks International s.a.l. www.netiks.com Mobile: +961 70975590 ---- Mail Disclaimer ---- This email and any files transmitted with it are confidential and are intended solely for the addressee(s). Any views or opinions expressed are solely those of the author and do not necessarily represent those of Netiks International sal unless otherwise specifically stated. If you are not the intended recipient of this e-mail, please delete it immediately from your system and notify the sender of the wrong delivery and the mail deletion. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. ---- End of Disclaimer ---- |
From: bertrum77 <rv...@po...> - 2009-09-30 20:51:16
|
Hamza Kamaleddine wrote: > > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > > Greetings, > > I have built a Web application [Initiator] on IIS using MS .Net framework > with QuickFix libraries versions 1.0.2447.42059 & 1.0.3512.29706, but when > I > try to start the initiator, I am getting this error below: > * > **Cannot pass a GCHandle across AppDomains. > Parameter name: handle > Source="mscorlib" > ParamName="handle" > StackTrace: > at > System.Runtime.InteropServices.GCHandle.InternalCheckDomain(IntPtr > handle) > at System.Runtime.InteropServices.GCHandle.FromIntPtr(IntPtr value) > at System.Runtime.InteropServices.GCHandle.op_Explicit(IntPtr > value) > at gcroot<QuickFix::Log ^>.->(gcroot<QuickFix::Log ^>* ) > at Log.onEvent(Log* , > basic_string<char\,std::char_traits<char>\,std::allocator<char> >* > string)* > > Please note that I have written the same code in a Windows application, > and > everything is working fine - only the problem is occurring in the Web > application. And I have tried also using multi-threading, but the problem > still persists. > > Do you know anything about this problem. Thank you. > > > Best Regards, > > Hamza A. Kamaleddine > Software Developer & Analyst > Netiks International s.a.l. > www.netiks.com > Mobile: +961 70975590 > > > ---- Mail Disclaimer ---- > This email and any files transmitted with it are confidential and are > intended solely for the addressee(s). Any views or opinions expressed are > solely those of the author and do not necessarily represent those of > Netiks > International sal unless otherwise specifically stated. If you are not the > intended recipient of this e-mail, please delete it immediately from your > system and notify the sender of the wrong delivery and the mail deletion. > Finally, the recipient should check this email and any attachments for the > presence of viruses. The company accepts no liability for any damage > caused > by any virus transmitted by this email. > ---- End of Disclaimer ---- > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Quickfix-users mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-users > > Hi I think this is happening because QuickFIX starts new threads of execution in the unmanaged code which result in calls to the managed code. This seems to happen in particular when the application is hosted by IIS or wcfsvchost etc... My problem was different from yours - I was getting this error when debugging a WCF service hosted in wcfsvchost. I got round it by hosting in a Windows Forms application, and adding the LoaderOptimization attribute to the Main method like so: [STAThread] [LoaderOptimization(LoaderOptimization.SingleDomain)] static void Main() { etc.. I know this won't sort out your web app issue as it's hosted in IIS, but hope the information is useful. Rob -- View this message in context: http://www.nabble.com/%22Cannot-pass-a-GCHandle-across-AppDomains%22-Problem-tp25026512p25688776.html Sent from the QuickFIX - User mailing list archive at Nabble.com. |