I have a windows forms project in vb.net to download csv files from a URL using CefSharp.Offscreen. I have created a task in task scheduler to call this project to download the csv files using CefSharp. But the download is not functioning when it is called from task scheduler and no errors/exceptions were logged.
Created a CustomDownloadHandler class which implemented IDownloadHandler interface and used below code in the main class:
Dim browser As ChromiumWebBrowser = New ChromiumWebBrowser("gave URL from which the file has to be downloaded")
browser.DownloadHandler = New CustomDownloadHandler()
The above code successfully works if it is called from a button click or form_load events where a UI is available. When the same code is called through a method from the task scheduler where a UI is not available to display, methods in CustomDownloadHndler class file is not getting executed and download is not happening.
How in vb.net make the csv files download from the URL using cefsharp.offscreen?