Author: andrews
Date: 2006-05-11 07:24:47 -0400 (Thu, 11 May 2006)
New Revision: 60585
Modified:
trunk/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Helper.cs
Log:
Load all referenced asseblies in parent domain before copying assemblies to new
domain.
Modified: trunk/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Helper.cs
===================================================================
--- trunk/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Helper.cs
2006-05-11 10:47:15 UTC (rev 60584)
+++ trunk/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Helper.cs
2006-05-11 11:24:47 UTC (rev 60585)
@@ -34,6 +34,9 @@
binDir = Directory.CreateDirectory (Path.Combine
(baseDir, "bin")).FullName;
foreach (Assembly ass in
AppDomain.CurrentDomain.GetAssemblies ())
+ LoadAssemblyRecursive (ass);
+
+ foreach (Assembly ass in
AppDomain.CurrentDomain.GetAssemblies ())
CopyAssembly (ass, binDir);
CopyResource (Assembly.GetExecutingAssembly (),
"NunitWeb.Resources.Web.config", "Web.config");
@@ -48,6 +51,25 @@
host.Initialize (this);
}
+ static void LoadAssemblyRecursive (Assembly ass)
+ {
+ if (ra.GlobalAssemblyCache)
+ return;
+ foreach (AssemblyName ran in
ass.GetReferencedAssemblies ()) {
+ bool found = false;
+ foreach (Assembly domain_ass in
AppDomain.CurrentDomain.GetAssemblies ()) {
+ if (domain_ass.FullName ==
ran.FullName) {
+ found = true;
+ break;
+ }
+ }
+ if (found)
+ continue;
+ Assembly ra = Assembly.Load (ran, null);
+ LoadAssemblyRecursive (ra);
+ }
+ }
+
private static void CopyAssembly (Assembly ass, string dir)
{
if (ass.GlobalAssemblyCache)
@@ -56,10 +78,14 @@
if (oldfn.EndsWith (".exe"))
return;
string newfn = Path.Combine (dir, Path.GetFileName
(oldfn));
-
+ if (File.Exists (newfn))
+ return;
File.Copy (oldfn, newfn);
}
+
+
+
static void EnsureDirectoryExists (string directory)
{
if (directory == string.Empty)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches