diff --git a/BizHawk.Client.DBMan/Program.cs b/BizHawk.Client.DBMan/Program.cs index cea5503d08..96a0a0aaa0 100644 --- a/BizHawk.Client.DBMan/Program.cs +++ b/BizHawk.Client.DBMan/Program.cs @@ -20,13 +20,13 @@ namespace BizHawk.Client.DBMan string dllDir = System.IO.Path.Combine(GetExeDirectoryAbsolute(), "dll"); SetDllDirectory(dllDir); + //in case assembly resolution fails, such as if we moved them into the dll subdiretory, this event handler can reroute to them + AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); + //but before we even try doing that, whack the MOTW from everything in that directory (thats a dll) //otherwise, some people will have crashes at boot-up due to .net security disliking MOTW. //some people are getting MOTW through a combination of browser used to download bizhawk, and program used to dearchive it WhackAllMOTW(dllDir); - - //in case assembly resolution fails, such as if we moved them into the dll subdiretory, this event handler can reroute to them - AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); #endif } diff --git a/BizHawk.Client.DiscoHawk/DiscoHawk.cs b/BizHawk.Client.DiscoHawk/DiscoHawk.cs index 7508c3bcd2..ee2b6eda31 100644 --- a/BizHawk.Client.DiscoHawk/DiscoHawk.cs +++ b/BizHawk.Client.DiscoHawk/DiscoHawk.cs @@ -29,13 +29,13 @@ namespace BizHawk.Client.DiscoHawk string dllDir = System.IO.Path.Combine(GetExeDirectoryAbsolute(), "dll"); SetDllDirectory(dllDir); + //in case assembly resolution fails, such as if we moved them into the dll subdiretory, this event handler can reroute to them + AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); + //but before we even try doing that, whack the MOTW from everything in that directory (thats a dll) //otherwise, some people will have crashes at boot-up due to .net security disliking MOTW. //some people are getting MOTW through a combination of browser used to download bizhawk, and program used to dearchive it WhackAllMOTW(dllDir); - - //in case assembly resolution fails, such as if we moved them into the dll subdiretory, this event handler can reroute to them - AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); #endif } diff --git a/BizHawk.Client.EmuHawk/Program.cs b/BizHawk.Client.EmuHawk/Program.cs index 1c6624d55c..c6a916a5a8 100644 --- a/BizHawk.Client.EmuHawk/Program.cs +++ b/BizHawk.Client.EmuHawk/Program.cs @@ -59,6 +59,9 @@ namespace BizHawk.Client.EmuHawk // this will look in subdirectory "dll" to load pinvoked stuff string dllDir = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "dll"); SetDllDirectory(dllDir); + + //in case assembly resolution fails, such as if we moved them into the dll subdiretory, this event handler can reroute to them + AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); //but before we even try doing that, whack the MOTW from everything in that directory (thats a dll) //otherwise, some people will have crashes at boot-up due to .net security disliking MOTW. @@ -67,9 +70,6 @@ namespace BizHawk.Client.EmuHawk //We need to do it here too... otherwise people get exceptions when externaltools we distribute try to startup - //in case assembly resolution fails, such as if we moved them into the dll subdiretory, this event handler can reroute to them - AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); - #endif } diff --git a/BizHawk.Client.MultiHawk/Program.cs b/BizHawk.Client.MultiHawk/Program.cs index 395ab0f0d2..69c5891ce1 100644 --- a/BizHawk.Client.MultiHawk/Program.cs +++ b/BizHawk.Client.MultiHawk/Program.cs @@ -24,13 +24,13 @@ namespace BizHawk.Client.MultiHawk string dllDir = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "dll"); SetDllDirectory(dllDir); + //in case assembly resolution fails, such as if we moved them into the dll subdiretory, this event handler can reroute to them + AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); + //but before we even try doing that, whack the MOTW from everything in that directory (thats a dll) //otherwise, some people will have crashes at boot-up due to .net security disliking MOTW. //some people are getting MOTW through a combination of browser used to download bizhawk, and program used to dearchive it WhackAllMOTW(dllDir); - - //in case assembly resolution fails, such as if we moved them into the dll subdiretory, this event handler can reroute to them - AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); #endif }