2

When running latex from C# using Process.Start, I'm getting this error: "latex: A required file system path could not be retrieved." It runs fine from the command line, so I'm not sure why it doesn't run from Process.Start. Has anyone run into this issue?

Edit: Also, this is from ASP.NET!

Thanks!

Shane Fulmer
  • 7,510
  • 6
  • 35
  • 43

2 Answers2

1

Without seeing more code, my best guess would be to set the WorkingDirectory of your StartInfo class to whatever directory it works from on the command line.

ProcessStartInfo startInfo = new ProcessStartInfo(@"\path\to\latex\latex.exe");
startInfo.WorkingDirectory = @"\path\to\latex";

I've run into this problem before with other EXE's and that seemed to be the fix.

CubanX
  • 5,176
  • 2
  • 29
  • 44
  • I have added it to the Path environment variable, so it runs from anywhere on the command line. I tried this just for kicks, but I'm getting the same error. It seems like LaTeX can't find (or doesn't have permission to use) something that it requires internally. Do I need to set permissions from Process.Start or something? – Shane Fulmer Nov 27 '10 at 04:28
1

The issue was IIS permissions.

Shane Fulmer
  • 7,510
  • 6
  • 35
  • 43