This following code is pretty simple and it works in a Console Application. But for some reason it does not work in a WCF Service. The directory which has the batch file has full permissions. Can someone help me? What am I missing?
    try
        {
            ProcessStartInfo psi = new ProcessStartInfo();
            //specify the name and the arguements you want to pass
            psi.FileName = ConfigurationManager.AppSettings["BatchFileLocation"];
            psi.Arguments = filePath; 
            //Create new process and set the starting information
            Proce开发者_StackOverflow社区ss p = new Process();
            p.StartInfo = psi;
            //Set this so that you can tell when the process has completed
            p.EnableRaisingEvents = true;
            p.Start();
            //wait until the process has completed
            while (!p.HasExited)
            {
                System.Threading.Thread.Sleep(1000);
            }
            //check to see what the exit code was
            if (p.ExitCode != 0)
            {
                logger.Write(p.ExitCode);
            }
        }
        catch (Exception ex)
        {
            logger.Write(ex.Message);
        }
I assume this an IIS Hosted WCF Service.
Check the Identity associated with your application pool.
In IIS 7, and 6.0 to the best of my knowledge, this is the NetworkService, which may or may not have rights to the Batch file, SFTP, etc. In 7.5 there is another account: Default Application Pool ID Changed in IIS 7.5. It is also possible that your pool is using some other account, including a machine specific one, and not a domain account.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论