Chr*_*nez 5 .net windows-server playwright
我使用 Playwright dotnet 构建了一个工具,它在本地运行得很好。我正在尝试将其部署在我的 Windows 服务器上,以便其他人可以使用它,问题是如何在服务器上正确安装无头浏览器。
如果我在服务器上的 Windows PowerShell 中执行https://playwright.dev/dotnet/docs/intro上的所有快速启动任务,则在执行该playwright install步骤之前一切都会正常进行。此时我收到以下错误:
未处理的异常:System.IO.FileNotFoundException:无法加载文件或程序集“System.Runtime,版本= 5.0.0.0 ...
即使我尝试输入命令,dotnet add package System.Runtime它也会添加包,但是当我playwright install再次尝试时,它会抛出相同的错误。
我什至尝试部署该应用程序,当我到达需要 Playwright 的部分时,它说:
Looks like Playwright Test or Playwright was just installed or updated.Please run the following command to download new browsers:
npx playwright install
(PS,验证器坚持上述错误是代码并且不会让我提交,除非这是这样格式化,这是愚蠢的)
所以我说搞砸了,在服务器上安装了 Node,然后运行 npx 命令,它说它安装了浏览器,但我仍然收到相同的错误,告诉我运行 npx 命令。
有没有人有幸在 Windows 服务器上安装并实施了 Playwright?