I have a very urgent requirement. I have a ASP.net application on framework 4.0 done in MVC architecture. In the application I am calling a Perl script to copy data from MySQL to SQL Server 2010 in the backend. When I run the application from Visual Studio 2010, the Perl script runs successfully and the data is copied. But when I deploy the same application on IIS 7.5, it does not show any change or the Perl scipt does not run. I tried printing each step of the code and found all the paths are coming correct. The perl script is to be run via a batch file.
Below is the code to start the process which runs a batch file which in turn runs the Perl script:
string strPath = string.Empty;
string strDirectory = string.Empty;
try {
strPath = "/k " + ConfigurationManager.AppSettings["UploadTLInfo"];//Path of the batch file comes from here
strDirectory = ConfigurationManager.AppSettings["WorkingDirectory"];
ProcessStartInfo psi = new ProcessStartInfo("cmd.exe",strPath);
psi.UseShellExecute = false;
psi.WorkingDirectory = strDirectory;
//psi.CreateNoWindow = true;
//psi.WindowStyle = ProcessWindowStyle.Hidden;
Process p = new Process();
p.StartInfo = psi;
p.Start();
} catch (Exception ex) {
throw ex;
}