From ce4d662e67c80a71f5ca15ba3147d240e31f0ce7 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 18 Jun 2015 12:53:24 -0400 Subject: [PATCH] Replace workaround with better solution Thanks @mlehmk --- TrueCraft.Client/Program.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/TrueCraft.Client/Program.cs b/TrueCraft.Client/Program.cs index 04d624a..e314a36 100644 --- a/TrueCraft.Client/Program.cs +++ b/TrueCraft.Client/Program.cs @@ -10,14 +10,14 @@ namespace TrueCraft.Client { public static class Program { + [STAThread] public static void Main(string[] args) { AppDomain.CurrentDomain.AssemblyResolve += AppDomain_CurrentDomain_AssemblyResolve; - var thread = new Thread(() => Main_Thread(args)); - thread.SetApartmentState(ApartmentState.STA); - thread.Start(); - thread.Join(); + // We need to run this in another method to avoid referencing MonoGame before registering + // our AssemblyResolve handler + Main_Thread(args); } static Assembly AppDomain_CurrentDomain_AssemblyResolve (object sender, ResolveEventArgs args)