title: process.BasePriority threw an Exception of Type 'System.InvalidOperationException'
body: <p>When I am trying to start a process from web API locally its started successfully but when I am hosting it to IIS 7.5 and try to start that process there is no response I am getting. when I tried to debug attaching the process to visual studio and start a debug I seen this error Process's BaseProperty  </p>
  
  <pre><code>process.BasePriority threw an Exception of Type 'System.InvalidOperationException'
  </code></pre>
  
  <p>I am starting a process to start a cmd.exe and here is the code:</p>
  
  <pre><code>public static void Start(long campaign_id, long contact_id, string startDate, string endDate, string user)
      {
          try
          {
              //WindowStyle = ProcessWindowStyle.Hidden;
              startInfo.FileName = "cmd.exe";
              startInfo.WorkingDirectory = @"C:\";
              startInfo.Arguments = "/c sparkclr-submit --master " + ConfigurationManager.AppSettings["SparkMaster"] + " --driver-class-path " + AppDomain.CurrentDomain.BaseDirectory + "Engine\\mysql.jar " + "--exe CmAnalyticsEngine.exe " + AppDomain.CurrentDomain.BaseDirectory + "Engine " + campaign_id + " " + contact_id + " " + startDate + " " + endDate + " " + user;
              startInfo.CreateNoWindow = false;
              startInfo.UseShellExecute = false;
              startInfo.LoadUserProfile = true;
              //startInfo.Verb = "runas";
              process.StartInfo = startInfo;
              process.Start();
              if (!process.HasExited)
              {
                  Console.WriteLine("process is running");
              }
              else
              {
                  Console.WriteLine("process is stopped");
              }
          }
          catch (Exception e)
          {
              LogWritter.WriteErrorLog(e);
          }
      }
  </code></pre>
  
  <p>when I am running this locally it works properly but on IIS its printing msg <strong>Process is stopped</strong>.</p>
  
  <p>do I need to give <strong>permission to cmd.exe</strong> to start from IIS? if yes then how to do it?</p>
  
  <p>Any help will be most appreciated.</p>
  
  <p>Thanks</p>