Replies: 1 comment
-
See #334 - it might be that WPF doesn't support using HostedServices, which Coravel uses under the covers :( |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I apologize early if this is a foolish or basic question i am trying to use Coravel within a C# WPF NET6 desktop application I am having problem trying to determine where you put the initialization code for Coravel such as below:
Example From Website
In your .NET Core app's Startup.cs file, inside the ConfigureServices() method, add the following:
services.AddScheduler()
Then in the Configure() method, you can use the scheduler:
var provider = app.ApplicationServices; provider.UseScheduler(scheduler => { scheduler.Schedule( () => Console.WriteLine("Every minute during the week.") ) .EveryMinute() .Weekday(); });
My goal is to be able to start the scheduled tasks from several buttons withing the WPF app, I like the idea of using DI along with the Invocables but i am struggling with where is configure and insert the code above. i have been looking in the App.xaml.cs portion and overriding the OnStartup method but not sure that is the proper location.
Any help/Examples would be awesome.
Thank You
Beta Was this translation helpful? Give feedback.
All reactions