该程序在Windows上运行良好。 我在Windows上以.Net Core模式发布了它。 但是我在Ubuntu上遇到了这个错误:
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”和无头模式,并在ubuntu上以root用户身份运行该程序。 因此,dotnet是否具有所有特权? 所有库均为最新版本。 我已经在互联网上进行搜索,但是找不到任何解决方案。