【发布时间】:2011-04-28 06:41:15
【问题描述】:
我有一个非常紧急的要求。我有一个在 MVC 架构中完成的框架 4.0 上的 ASP.net 应用程序。在应用程序中,我调用 Perl 脚本将数据从 MySQL 复制到后端的 SQL Server 2010。当我从 Visual Studio 2010 运行应用程序时,Perl 脚本成功运行并复制了数据。但是当我在 IIS 7.5 上部署相同的应用程序时,它没有显示任何更改或 Perl scipt 没有运行。我尝试打印代码的每一步,发现所有路径都正确。 perl 脚本将通过批处理文件运行。
下面是启动运行批处理文件的过程的代码,该批处理文件又运行 Perl 脚本:
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;
}
【问题讨论】:
-
这篇文章可能会有所帮助stackoverflow.com/questions/922234/…
标签: asp.net perl iis deployment