Headless Google Chrome不会在Windows Server 2016中通过ASP.NET Core 2.2触发

问题描述 投票:0回答:1

我正在尝试使用ASP.NET Core 2.2中的代码使用Google Chrome Headless生成PDF。

        string args = $"--headless --disable-gpu --print-to-pdf={targetFile} {file}";
        string chrome = "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe";

        ProcessStartInfo inkscapeInfo = new ProcessStartInfo(chrome, args);
        Process inkscape = Process.Start(inkscapeInfo);
        inkscape.WaitForExit(5000);

在我的本地计算机和Visual Studio

上都很好用,但是当我将其上传到Windows 2016 Server上却不起作用,我检查了chrome.exe路径,并且在服务器上是正确的。实际上,我尝试了其他一些可能的解决方案,但似乎没有[[exe文件不仅触发无头Chrome,我该怎么办?[我正在尝试使用Google Chrome Headless生成PDF,在ASP.NET Core 2.2中使用以下代码:string args = $“-headless --disable-gpu --print-to-pdf = {targetFile} {file} “;字符串...
c# asp.net-core impersonation google-chrome-headless windows-server-2016
1个回答
1
投票
我已将

IUs​​er_DomainName

用户添加到
    administrative组。
  1. 我将此用户添加到chrome.exe
  2. 并授予其完全权限。他们一个人都没有工作!
© www.soinside.com 2019 - 2024. All rights reserved.