[Adapdev-commits] Adapdev/src/Adapdev AppDomainManager.cs,1.1.1.1,1.2
Status: Beta
Brought to you by:
intesar66
From: Sean M. <int...@us...> - 2005-04-23 04:54:22
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25984/src/Adapdev Modified Files: AppDomainManager.cs Log Message: Index: AppDomainManager.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev/AppDomainManager.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** AppDomainManager.cs 28 Feb 2005 01:31:36 -0000 1.1.1.1 --- AppDomainManager.cs 23 Apr 2005 04:54:14 -0000 1.2 *************** *** 40,43 **** --- 40,45 ---- namespace Adapdev { + using log4net; + /// <summary> /// Summary description for Class1. *************** *** 55,58 **** --- 57,63 ---- private string basedir = String.Empty; + // create the logger + private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + /// <summary> /// Creates a new <see cref="AppDomainManager"/> instance. *************** *** 74,78 **** /// </summary> /// <param name="basedir">Basedir.</param> ! /// <param name="domainName">Name of the domain.</param> /// <param name="shadowCopyDirectories">Shadow copy directories.</param> public AppDomainManager(string basedir, string configFile, params string[] shadowCopyDirectories) : this(basedir, "Test", configFile, shadowCopyDirectories){} --- 79,83 ---- /// </summary> /// <param name="basedir">Basedir.</param> ! /// <param name="configFile">Name of the configuration file to use.</param> /// <param name="shadowCopyDirectories">Shadow copy directories.</param> public AppDomainManager(string basedir, string configFile, params string[] shadowCopyDirectories) : this(basedir, "Test", configFile, shadowCopyDirectories){} *************** *** 81,85 **** /// Creates a new <see cref="AppDomainManager"/> instance. /// </summary> ! /// <param name="domainName">Name of the domain.</param> /// <param name="shadowCopyDirectories">Shadow copy directories.</param> public AppDomainManager(string basedir, params string[] shadowCopyDirectories) : this(basedir, "Test", shadowCopyDirectories){} --- 86,90 ---- /// Creates a new <see cref="AppDomainManager"/> instance. /// </summary> ! /// <param name="basedir">The base directory to use.</param> /// <param name="shadowCopyDirectories">Shadow copy directories.</param> public AppDomainManager(string basedir, params string[] shadowCopyDirectories) : this(basedir, "Test", shadowCopyDirectories){} *************** *** 96,99 **** --- 101,106 ---- this.domainType = DomainType.Remote; + if(log.IsDebugEnabled) log.Debug("Loading new AppDomainManager"); + Evidence baseEvidence = AppDomain.CurrentDomain.Evidence; Evidence evidence = new Evidence(baseEvidence); *************** *** 104,107 **** --- 111,121 ---- if(configurationFile.Length > 0) setup.ConfigurationFile = configurationFile; + if(log.IsDebugEnabled) + { + log.Debug("ApplicationBase: " + setup.ApplicationBase); + log.Debug("ApplicationName: " + setup.ApplicationName); + log.Debug("ConfigurationFile: " + setup.ConfigurationFile); + } + if(shadowCopyDirectories != null && shadowCopyDirectories.Length >= 0) { *************** *** 146,149 **** --- 160,164 ---- { string assemblyDirectory = Path.GetDirectoryName( path ); + if(log.IsDebugEnabled)log.Debug("Adding " + path); if(this.domainType == DomainType.Local) *************** *** 199,202 **** --- 214,225 ---- if(!(this.domainName == String.Empty) && !unloaded) { + if(log.IsDebugEnabled) + { + foreach(AssemblyInfo a in this.GetLoadedAssemblies()) + { + log.Debug("Unloading: " + a.Name + " - " + a.Version + " - " + a.Location); + } + } + // Must unload AppDomain first, before you can delete the shadow copy directory AppDomain.Unload(this.domain); *************** *** 208,211 **** --- 231,235 ---- unloaded = true; + if(log.IsDebugEnabled) log.Debug("Domain unloaded."); } } *************** *** 283,287 **** { if(guid.Length > 0) ! return Path.Combine(Path.GetTempPath(),guid); return String.Empty; } --- 307,311 ---- { if(guid.Length > 0) ! return Path.Combine(Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "zanebugcache"),guid); return String.Empty; } *************** *** 318,321 **** --- 342,346 ---- return domain.CreateInstanceAndUnwrap(name, classname); } + } |