Я использовал IHttpHandler, который компилирует файлы SASS с компасом с IIS 7.5. С тех пор обновления до окон 8.1 и IIS 8.5, это не работает и реагирует с сообщением наблюдения:Команды, отсутствующие в командной строке, начинаются с IIS 8.5
/*-----------------------------------------------------------------------------------------------
//
// compass compile "theme/default/style/custom.sass" --trace --debug-info --css-dir "data/compass"
//
// 'compass' is not recognized as an internal or external command,
// operable program or batch file.
//
//---------------------------------------------------------------------------------------------*/
Вот часть кода, который выполняет процесс (исх Dado.Compass.SingleFileHandler.cs):
void IHttpHandler.ProcessRequest(HttpContext context)
{
// Gather Compass Configuration Variables
ReadConfiguration(context);
string baseDir = Path.GetDirectoryName(context.Request.Path).Replace(@"\", "/");
string fileName = Path.GetFileName(context.Request.Path);
string command = String.Format(@"compass compile ""{0}"" --trace --debug-info --css-dir ""{1}""",
(baseDir + "/" + fileName).Trim(new char[] { '\\', '/' }),
_cachePath.Trim(new char[] { '\\', '/' })
);
ProcessStartInfo psi = new ProcessStartInfo()
{
FileName = "cmd.exe",
WorkingDirectory = context.Server.MapPath("~/"),
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true,
CreateNoWindow = true,
Arguments = "/c " + command
};
using (Process process = new Process { StartInfo = psi }) {
bool hasError = false;
...
Я m работает под ApplicationPoolIdentify и предоставил одинаковые разрешения. Кроме того, компас доступен, когда я пытаюсь выполнить его команду из cmd.exe.
Почему команда появляется из экземпляра IIS cmd.exe?