Esempio n. 1
0
        public void InitializeDomain(TraceLevel traceLevel)
        {
            InternalTrace.Initialize("%a_%p.log", traceLevel);
            log = InternalTrace.GetLogger(typeof(DomainInitializer));

            log.Info("Initializing domain " + AppDomain.CurrentDomain.FriendlyName);
            AppDomain.CurrentDomain.DomainUnload += new EventHandler(OnDomainUnload);

            AssemblyResolver resolver = new AssemblyResolver();

            resolver.AddDirectory(NUnitConfiguration.NUnitLibDirectory);
            resolver.AddDirectory(NUnitConfiguration.AddinDirectory);
        }
Esempio n. 2
0
        public void InitializeDomain(int level)
        {
            InternalTraceLevel traceLevel = (InternalTraceLevel)level;

            InternalTrace.Initialize("%a_%p.log", traceLevel);
            log = InternalTrace.GetLogger(typeof(DomainInitializer));

            AppDomain domain = AppDomain.CurrentDomain;

            log.Info("Initializing domain {0}", domain.FriendlyName);
            log.Debug("  Base Directory: {0}", domain.BaseDirectory);
            log.Debug("  Probing Path: {0}", domain.SetupInformation.PrivateBinPath);

            domain.DomainUnload += new EventHandler(OnDomainUnload);

            AssemblyResolver resolver = new AssemblyResolver();

            resolver.AddDirectory(NUnitConfiguration.NUnitLibDirectory);
            resolver.AddDirectory(NUnitConfiguration.AddinDirectory);
        }
        public void InitializeDomain(int level)
        {
            InternalTraceLevel traceLevel = (InternalTraceLevel)level;

            InternalTrace.Initialize("%a_%p.log", traceLevel);
            log = InternalTrace.GetLogger(typeof(DomainInitializer));

            AppDomain domain = AppDomain.CurrentDomain;

            log.Info("Initializing domain {0}", domain.FriendlyName);
            log.Debug("  Base Directory: {0}", domain.BaseDirectory);
            log.Debug("  Probing Path: {0}", domain.SetupInformation.PrivateBinPath);

            domain.DomainUnload += new EventHandler(OnDomainUnload);

            AssemblyResolver resolver = new AssemblyResolver();

            resolver.AddDirectory(NUnitConfiguration.NUnitLibDirectory);
            resolver.AddDirectory(NUnitConfiguration.AddinDirectory);

            // TODO: Temporary additions till we resolve a problem with pnunit
            // Test for existence is needed to avoid messing when the installation
            // does not include pnunit.
            string binDir = NUnitConfiguration.NUnitBinDirectory;
            string pnunitFrameworkPath = Path.Combine(binDir, "pnunit.framework.dll");

            if (File.Exists(pnunitFrameworkPath))
            {
                resolver.AddFile(pnunitFrameworkPath);
            }
            string pnunitAgentPath = Path.Combine(binDir, "pnunit-agent.exe");

            if (File.Exists(pnunitAgentPath))
            {
                resolver.AddFile(pnunitAgentPath);
            }
        }
 private void CurrentDomain_DomainUnload(object sender, EventArgs e)
 {
     log.Debug(AppDomain.CurrentDomain.FriendlyName + " unloaded");
     InternalTrace.Flush();
 }
 void OnDomainUnload(object sender, EventArgs e)
 {
     log.Info("Unloading domain " + AppDomain.CurrentDomain.FriendlyName);
     InternalTrace.Flush();
 }