Web アプリケーション (Visual Studio 開発サーバーで実行中) から外部の exe を起動しようとしています。以下のコードをコンソール アプリケーションから実行すると正常に動作しますが、Web ページから実行するとアプリケーションがクラッシュします。これは権限の問題に違いないと思いますが、いくつか試してみましたが、うまくいきませんでした。
private void RunExe(string pythonOutputFileNameAndLocation)
{
var process = new Process { StartInfo = GetProcessStartInfo(pythonOutputFileNameAndLocation) };
// This is where the application crashes
process.Start();
// ...do some more things here
}
private ProcessStartInfo GetProcessStartInfo(string pythonOutputFileNameAndLocation)
{
var startInfo = new ProcessStartInfo
{
CreateNoWindow = true,
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardInput = true,
FileName = _exeFileLocation,
WindowStyle = ProcessWindowStyle.Hidden,
Arguments = String.Format("--hideUI --runScript {0}", pythonOutputFileNameAndLocation)
};
return startInfo;
}
私が求めているのは、なぜこのコードがコンソール アプリケーションからは機能するのに、Visual Studio Web サーバーからは機能しないのかということです。
Windows 7 と Visual Studio 2010 を使用しています。
編集:
ここで要求されているように、Windows によって検出された問題の詳細は次のとおりです。
問題イベント名: BEX アプリケーション名: アプリケーションのバージョン: 2.2.2.2909 アプリケーションのタイムスタンプ: 507bf285 障害モジュール名: MSVCR100.dll 障害モジュールのバージョン: 10.0.40219.325 障害モジュールのタイムスタンプ: 4df2be1e 例外オフセット: 0008af3e 例外コード: c0000417 例外データ: 00000000 OS バージョン: 6.1.7601.2.1.0.256.48 ロケール ID: 2057 追加情報 1: c5a0 追加情報 2: c5a0d9e876212c0d3929ba8445f002dc 追加情報 3: 5e93 追加情報 4: 5e93e44f8aa24f99d37e055f533d1658
コードがないため、外部アプリケーションをデバッグできません。また、例外が発生していないため、スタック トレースもありません。外部プロセスがクラッシュしています。
ありがとう