Index: mini/mini.c =================================================================== --- mini/mini.c (revision 88138) +++ mini/mini.c (working copy) @@ -9027,6 +9032,7 @@ if (!TlsGetValue (mono_jit_tls_id)) mono_thread_attach (domain); #endif + mono_domain_set (domain, TRUE); } /** Index: mini/mini-x86.c =================================================================== --- mini/mini-x86.c (revision 88138) +++ mini/mini-x86.c (working copy) @@ -3622,7 +3622,7 @@ if (method->wrapper_type == MONO_WRAPPER_NATIVE_TO_MANAGED) { /* Might need to attach the thread to the JIT */ - if (lmf_tls_offset != -1) { + if (0 && lmf_tls_offset != -1) { guint8 *buf; code = emit_tls_get ( code, X86_EAX, lmf_tls_offset);