This following code is pretty simple and works in a console application. But for some reason, it does not work in the WCF service. A directory that has a batch file has full permissions. Can anybody 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 Process 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 is an IIS Hosted WCF Service.
Check the identifier associated with the application pool.
IIS 7 6.0, , NetworkService, , SFTP .. 7.5 : , IIS 7.5. , , , .
Source: https://habr.com/ru/post/1775069/More articles:view jQuery and IE8 compatibility - performanceMPMoviePlayerController will not play movies on iPhone 3G in release mode, but will work in debug mode - iphoneActionScript 2 loads another SWF that loads other files - relative path / url problem - actionscript-2python: how to create a persistent structure in memory for debugging - pythonJUnit: tool for comparing results reports - javaDepth test is inverted by default in OpenGL or am I mistaken? - transparencyChoosing Opengl with alpha test - openglКак загрузить только необходимые части удаленного проекта в Git? - gitPython script opens bash prompt to end script - pythonWhy is explicit returning 0 from main () considered good practice? - c ++All Articles