I wrote a C# Winform application that performs a task without user input and I want to run this program on a schedule (every day at 1 AM, for example). I want to set the program up on Azure so it runs on the cloud.
So far, I've successfully run C# Console applications in Azure Webjobs (a service under Azure Web Apps) and those work fine, but if I try to upload and run a Winform I get the error:
[03/03/2016 17:27:12 > 252553: ERR ] Unhandled Exception: System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
[03/03/2016 17:27:12 > 252553: ERR ] at System.Windows.Forms.UnsafeNativeMethods.IWebBrowser2.Navigate2(Object& URL, Object& flags, Object& targetFrameName, Object& postData, Object& headers)
[03/03/2016 17:27:12 > 252553: ERR ] at System.Windows.Forms.WebBrowser.PerformNavigate2(Object& URL, Object& flags, Object& targetFrameName, Object& postData, Object& headers)
[03/03/2016 17:27:12 > 252553: ERR ] at System.Windows.Forms.WebBrowser.set_Url(Uri value)
[03/03/2016 17:27:12 > 252553: ERR ] at WebBrowserTest.Form1.InitializeComponent()
[03/03/2016 17:27:12 > 252553: ERR ] at WebBrowserTest.Form1..ctor()
[03/03/2016 17:27:12 > 252553: ERR ] at WebBrowserTest.MainStartup.Main()
[03/03/2016 17:27:12 > 252553: SYS INFO] Status changed to Failed
in the logs. In the code, the error is specifically on a line like where I try to call webBrowser.Navigate function.
Uri uri = new Uri("https://www.website.com");
webBrowser1.Navigate(uri);
The URL itself is absolutely correct and it works when I run it on my desktop, but I guess something about changing URLs in a C# Webbrowser doesn't work.
So my question is, what Azure service will let me run a winform on a schedule? And if not Azure, I'll take Amazon or some other service. (I don't want to have my own dedicated physical computer to have to run this program. Thanks.