Exemple #1
0
 public static void copyDllAndPdb(String sSourceDll, String sTargetDll, bool bOveride)
 {
     try
     {
         if (File.Exists(sSourceDll))
         {
             File.Copy(sSourceDll, sTargetDll, bOveride);
             sSourceDll = sSourceDll.directoryName()
                                    .pathCombine(sSourceDll.fileName_WithoutExtension() + ".pdb");
             if (File.Exists(sSourceDll))
             {
                 sTargetDll = sTargetDll.directoryName().pathCombine(sTargetDll.fileName_WithoutExtension() + ".pdb");
                 File.Copy(sSourceDll, sTargetDll, bOveride);
             }
         }
     }
     catch (Exception ex)
     {
         PublicDI.log.error("in copyDllAndPdb:{0}", ex.Message);
     }
 }
Exemple #2
0
        public static Process startProcess(String sProcessToStart, String sArguments, bool createNoWindow)
        {
            try
            {
                PublicDI.log.debug("Starting process {0} with arguments {1}", sProcessToStart, sArguments);
                var pProcess = new Process
                    {
                        StartInfo = new ProcessStartInfo
                            {
                                Arguments = sArguments,
                                FileName = sProcessToStart,
                                WorkingDirectory = sProcessToStart.directoryName()
                            }
                    };

                if (createNoWindow)
                {
                    pProcess.StartInfo.CreateNoWindow = true;
                    pProcess.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;
                }
                pProcess.Start();
                return pProcess;
            }
            catch (Exception ex)
            {
                PublicDI.log.ex(ex, "in startProcess");
                return null;
            }
        }