从 C# 运行 Latex

发布于 2024-10-04 20:15:23 字数 162 浏览 0 评论 0原文

当使用 Process.Start 从 C# 运行 Latex 时,我收到此错误:“latex:无法检索所需的文件系统路径。”它从命令行运行良好,所以我不确定为什么它不能从 Process.Start 运行。有人遇到过这个问题吗?

编辑:另外,这是来自 ASP.NET!

谢谢!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

抽个烟儿 2024-10-11 20:15:23

如果没有看到更多代码,我最好的猜测是将 StartInfo 类的工作目录设置为它在命令行上工作的任何目录。

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

我之前在使用其他 EXE 时也遇到过这个问题,这似乎是解决办法。

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.

蘸点软妹酱 2024-10-11 20:15:23

问题是 IIS 权限。

The issue was IIS permissions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文