Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application crashes if it is launched from Windows Task Scheduler #2365

Closed
HeiVask opened this issue Apr 19, 2018 · 4 comments
Closed

Application crashes if it is launched from Windows Task Scheduler #2365

HeiVask opened this issue Apr 19, 2018 · 4 comments

Comments

@HeiVask
Copy link

HeiVask commented Apr 19, 2018

  • What version of the product are you using?

    • Nuget (v63.0.3.0)
  • What architecture x86 or x64?

    • x86
  • On what operating system?

    • Windows 10, Windows Server 2016
  • Are you using WinForms, WPF or OffScreen?

    • WinForms
  • What steps will reproduce the problem?

    • Running the application from the Task Scheduler (testable also with the Minimal Example).
  • What is the expected output? What do you see instead?

    • Expected: Normal behaviour
    • Instead: The Task Manager shows the application still running, but it is freezed, with no log from the own application.
  • Please provide any additional information below.

    • The Event Viewer shows an unhandled exception:

Aplicación: CefSharp.BrowserSubprocess.exe
Versión de Framework: v4.0.30319
Descripción: el proceso terminó debido a una excepción no controlada.
Información de la excepción: System.ArgumentException
en System.ThrowHelper.ThrowArgumentException(System.ExceptionResource)
en System.Collections.Generic.Dictionary2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Insert(System.__Canon, System.__Canon, Boolean) en System.Collections.Generic.Dictionary2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Add(System.__Canon, System.__Canon)
en .CefSharp.CefAppUnmanagedWrapper.OnProcessMessageReceived(CefSharp.CefAppUnmanagedWrapper*, scoped_refptr, cef_process_id_t, scoped_refptr)
en .CefExecuteProcess(CefMainArgs*, scoped_refptr, Void)
en CefSharp.BrowserSubprocess.SubProcess.Run()
en CefSharp.BrowserSubprocess.Program.Main(System.String[])

  • Does the cef log provide any relevant information? (By default there should be a debug.log file in your bin directory)

    • debug.log is empty
  • Does this problem also occur in the CEF Sample Application from http://opensource.spotify.com/cefbuilds/index.html?

    • No, it doesn't. Tested with cef_binary_3.3325.1758.g9aea513_windows32_client
@amaitland
Copy link
Member

How exactly is task scheduler relevant in this case?

It's quite hard to read the stack trace, if I had to guess I'd say this is a duplicate of #2301

@cefsharp cefsharp deleted a comment from welcome bot Apr 19, 2018
@HeiVask
Copy link
Author

HeiVask commented Apr 20, 2018

Sincerely I have no idea. It's relevant because executing the application directly it works (double clicking on it), but if it's executed by the task scheduler it doesn't. I've tested also with the minimal example, launched from the task scheduler it doesn't open. It runs and appears on the task manager but it's freezed.

Sorry but there is no more information than that stack trace. Not sure also if it could be a duplicate of #2301. In this case there is only one execution with one instance of a browser. I tested it on two machines with win10 and one with winserver2016 with the same result.

@amaitland
Copy link
Member

Did you by chance happen to compare the two stack traces? There are two dictionary adds in that section of code and only one can cause that exception. Is the stack trace provided relevant to the problem you've reported?

Since your app works when run directly it's unlikely a bug in CefSharp, more likely an environment/configuration issue. Have you confirmed that the exception is generated every time?

I expect task scheduler to cause problems, mostly stemming from the current director not being set correctly, if you log Environment.CurrentDirectory what do you get?

https://stackoverflow.com/questions/447774/specifying-the-running-directory-for-scheduled-tasks-using-schtasks-exe

@HeiVask
Copy link
Author

HeiVask commented Apr 20, 2018

Effectively it was an environment configuration issue. Putting the start directory in the task window (as the SO link indicates) solves the issue, so it is not a CefSharp bug. Sorry for the inconvenience and thank you very much.

@HeiVask HeiVask closed this as completed Apr 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants