首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在ubuntu18.04.3LTS服务器上启动PuppeteerSharp?System.ComponentModel.Win32Exception (13):权限被拒绝

如何在ubuntu18.04.3LTS服务器上启动PuppeteerSharp?System.ComponentModel.Win32Exception (13):权限被拒绝
EN

Stack Overflow用户
提问于 2019-11-05 01:08:35
回答 1查看 763关注 0票数 0

该程序在Windows上运行良好。我在Windows上以.Net核心模式发布了它。但我在Ubuntu上得到了这个错误:

代码语言:javascript
复制
 `Unhandled exception. System.ComponentModel.Win32Exception (13): Permission denied    at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)    at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)    at System.Diagnostics.Process.Start()    at PuppeteerSharp.ChromiumProcess.State.StartingState.StartCoreAsync(ChromiumProcess p)    at PuppeteerSharp.Launcher.LaunchAsync(LaunchOptions options)    at PuppeteerSharp.Launcher.LaunchAsync(LaunchOptions options)    at WebScraping.Authorization.GetCookieByAuthorizationAsync(String[] args, String pathToCookieFile) in C:\Users\Serega\Desktop\dz4all\Homework\WebScraping\Authorization.cs:line 22    at WebScraping.Program.Main(String[] args) in C:\Users\Serega\Desktop\dz4all\Homework\WebScraping\Program.cs:line 41    at WebScraping.Program.<Main>(String[] args)` 

我可以假设Visual Studio已经发布了仅适用于Windows系统的项目。我的Ubuntu只是个终端。我已经在启动PuppeteerSharp的设置中设置了"--no-sandbox“和headless-mode,并在ubuntu上以根用户的身份运行程序。因此,dotnet是否拥有所有的root特权?所有的库都是最新版本。我已经在互联网上搜索过了,但没有找到任何解决方案。

EN

回答 1

Stack Overflow用户

发布于 2019-11-05 17:36:03

我解决了这个问题。我的工作目录是/root/ServerLinux,我写了这个命令:sudo chmod -R 777 ServerLinux at /root。一切正常!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58698095

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档