Пример #1
0
        public static void Host([MarshalAs(UnmanagedType.LPWStr)]string loadDir)
        {
            #if LAUNCH_MDA
            System.Diagnostics.Debugger.Launch();
            #endif
            loadDir = Path.GetDirectoryName(loadDir);
            Trace.Assert(Directory.Exists(loadDir));

            Trace.Listeners.Add(new TextWriterTraceListener(Path.Combine(loadDir, @"Logs\", APP_NAME + ".Loader.log")));

            try
            {
                using (var host = new PathedDomainHost(APP_NAME, loadDir))
                {
                    host.Execute();
                }
                //var asm_bytes = File.ReadAllBytes(_dllPath);

                //var args = new Object[] {
                //    new String[] {
                //        path
                //    }
                //};

                //var asm = Assembly.Load(asm_bytes);
                //return Convert.ToInt32(asm.EntryPoint.Invoke(null, args));
            }
            catch (Exception e)
            {
                Trace.TraceError(e.ToString());
            }
        }
Пример #2
0
        public static void Host([MarshalAs(UnmanagedType.LPWStr)] string loadDir)
        {
#if LAUNCH_MDA
            System.Diagnostics.Debugger.Launch();
#endif
            loadDir = Path.GetDirectoryName(loadDir);
            Trace.Assert(Directory.Exists(loadDir));

            Trace.Listeners.Add(new TextWriterTraceListener(Path.Combine(loadDir, @"Logs\", APP_NAME + ".Loader.log")));

            try
            {
                using (var host = new PathedDomainHost(APP_NAME, loadDir))
                {
                    host.Execute();
                }
                //var asm_bytes = File.ReadAllBytes(_dllPath);

                //var args = new Object[] {
                //    new String[] {
                //        path
                //    }
                //};

                //var asm = Assembly.Load(asm_bytes);
                //return Convert.ToInt32(asm.EntryPoint.Invoke(null, args));
            }
            catch (Exception e)
            {
                Trace.TraceError(e.ToString());
            }
        }
Пример #3
0
        public static void HostDomain()
        {
#if LAUNCH_MDA
            System.Diagnostics.Debugger.Launch();
#endif
            var directory = Path.GetDirectoryName(ApplicationToHostDirectory);
            // ReSharper disable once AssignNullToNotNullAttribute
            var exists = Directory.Exists(directory);
            Trace.Assert(exists);
            try
            {
                using (var host = new PathedDomainHost(ApplicationToHostDirectory))
                {
                    host.Execute();
                }
            }
            catch (Exception e)
            {
                Trace.WriteLine(e.ToString());
            }
        }
Пример #4
0
        public static void Host([MarshalAs(UnmanagedType.LPStr)] string loadDir, [MarshalAs(UnmanagedType.LPStr)] string name)
        {
#if LAUNCH_MDA
            System.Diagnostics.Debugger.Launch();
#endif
            //loadDir = Path.GetDirectoryName(loadDir);
            Trace.Assert(Directory.Exists(loadDir));

            Trace.Listeners.Add(new TextWriterTraceListener(Path.Combine(loadDir, @"Logs\", name + ".Loader.log")));

            try
            {
                using (var host = new PathedDomainHost(name, loadDir))
                {
                    host.Execute();
                }
            }
            catch (Exception e)
            {
                Trace.TraceError(e.ToString());
            }
        }
Пример #5
0
        public static void HostDomain()
        {
#if LAUNCH_MDA
            System.Diagnostics.Debugger.Launch();
#endif
            ApplicationToHostDirectory = Path.GetDirectoryName(ApplicationToHostDirectory);
            Trace.Assert(Directory.Exists(ApplicationToHostDirectory));
            Trace.Listeners.Add(
                new TextWriterTraceListener(Path.Combine(ApplicationToHostDirectory, @"Logs\",
                    ApplicationToHostName + ".PatchedDomainLoader.log")));

            try
            {
                using (var host = new PathedDomainHost(ApplicationToHostName, ApplicationToHostDirectory))
                {
                    host.Execute();
                }
            }
            catch (Exception e)
            {
                Trace.TraceError(e.ToString());
            }
        }