If you're doing this on v1.0/v1.1 what you suggest will work most of the time as you've observed but Whidbey had a breaking change to make this more predictable:
http://www.gotdotnet.com/team/changeinfo/Backwards1.1to2.0%5Cdefault.aspx - search for Initialization of MTA and STA threads Probably the best way to deal w/ this (other than having 2 EXEs) now is to create a new thread and mark the thread state before starting the thread. Then you can have the main thread die off or do a Join on the new thread and report back the exit code. But maybe your trampoline is already spinning up a new thread... -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Lam Sent: Monday, December 12, 2005 10:06 AM To: Discussion of IronPython Subject: Re: [IronPython] Problems with tutorials IMHO, this is a feature that should be enabled via a command-line switch; you can't back out of your choice that you make at startup time without potentially serious consequences. I'm doing this via a command line switch + a trampoline function in my Ruby CLR bridge. It seems to be the best approach (even though there are still corner cases in the way I do it since there's no way for me to prevent someone else from turning on COM before the CLR (and my stuff) is delay-loaded. Cheers, -John http://www.iunknown.cm -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Martin Maly Sent: Monday, December 12, 2005 12:52 PM To: Discussion of IronPython Subject: Re: [IronPython] Problems with tutorials Believe it or not, this problem is actually caused by the missing [STAThread] attribute on the IronPythonConsole Main. Good to know this :) Seems that when I remove it, I caused problems for more people than I helped. As I said in my previous email to Jacques, I am going to fix this for the next release. If there is no beter way to do that, I am going to put the [STAThread] attribute back. It is also the workaround for the time being. Thanks for the bug report, Keith! Martin -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Keith J. Farmer Sent: Monday, December 12, 2005 1:51 AM To: Discussion of IronPython Subject: [IronPython] Problems with tutorials Encountering a variety of problems with the agents tutorial: a = AgentServerClass() -> should not have () ? a.Load("Merlin.acs") -> throws bad args exception for the Load() method. Doesn't change if I use C:\WINDOWS\msagent\chars\merlin.acs, which exists on my machine. Also doesn't work if I call AgentServerClass.Load("merlin.acs"). NB: I'm using x64. With the Avalon tutorial, I get "can't set arbitrary attributes on built-in type System.Windows.Window" when I try w.Text = "My Avalon Application". Trying to retrieve w.Text gives no-such-attribute error. w.Title does exist, however. w.Content.TextContent should be w.Content.Text, I think. w.Content.PersistentAnimations doesn't exist, and I don't see any likely rename. ----- Keith J. Farmer // [EMAIL PROTECTED] _______________________________________________ users mailing list users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com