I want to work with job scheduling and browsing on the internet I saw that Quartz.Net is a good option for it. Many blogs show that a windows service must be initialized and my question is: is it always necessary to start a windows service and embed it to run a job scheduler? Is there a way to run a job scheduler without using a windows service, I ask this because I have a access to a hosting that has only a web panel and I don't think it will let start a windows service.
Thanks for reading
Well, a alternative to writing a simple windows service, is to use the inbuilt windows task scheduler, if you have administrative permissions on the machine you would like to configure. To configure a task in Task Scheduler, have a look at the following Microsoft Article
Working with a windows service is very simple too, a good starting point is as shown below
Walkthrough: Creating a Windows Service Application in the Component Designer
I have worked on Quartz.NET and recommend it highly. The best resources that I used when working with Quartz are as given in the following SO Post.
Quartz can also be used in a ASP.NET web application
How to use Quartz.net with ASP.NET
Quartz.net setup in an asp.net website
Related
I've developed a Windows service. It installs, runs and serves its purpose. To view the results it produces, I'd like to add a simple web page with Select * from the database the services works with.
Would someone please elaborate on how to make Windows service serve a web page?
Ideally, I'd like to learn from the code of a similar project
ps. IIS is already installed on the host where the service runs
Turned out easier than I thought https://www.youtube.com/watch?v=YUPg41kG_kw&ab_channel=BoostMyTool
I've achieved something like this by making use of the Worker Services in .NET Core and configuring the service to run as a Windows Service.
And because I had a worker service in .NET Core, I could easily add HTTP workloads like MVC or Blazor.
In my example, I had a windows service running worker tasks as well as a Blazor UI to show the details of what was happening (I scaffolded the Blazor code fist and then added the worker via AddHostedService).
The benefit of this is that the .NET Core is acting as the server do this process didn't need IIS on the platform plus both areas of the system are part of the same process.
If the above isn't suitable (or requires a huge migration to .NET Core), then I'd suggest using Named Pipes to communication from one process (your windows service) to another (your web-app).
I have a saas web application using asp web api hosted in azure. I need to schedule some tasks to:
Generate monthly/yearly billing
Run recurring sql script
Send daily summary to users by email
Any recommendation or pointer on how i can do this? Should i create another app or can i host it inside my web api app?
If you want to have a reliable tasks scheduling wherein you can apply time interval depend on your choice, I recommend Quartz. Quartz allow to add/edit/delete/etc a scheduled task easily, manageable and no CPU overhead.
This is what Azure Web Jobs are for - running background tasks. It is a feature of the Azure Web App your Web API is running in. You can set it up as a scheduled job using the Azure Scheduler. How to do this is also in the link I provided.
I have a job I'd like to run on my new Azure hosted web app. In the old pre-Azure days, I would create an .aspx page that did the job, then have some service that simply called the url (www.mysite.com/folder/myjob.aspx) on a schedule.
Is there a better way to do this with webjobs? Can I interact with the actual object model of my site or am I restricted to public URLs and the such?
I've heard I can write a full application (.exe) and host that, but I'm wondering what the advantage of that is?
There are a couple of ways to do this
Azure Worker Roles -Create a console application and then spin this cloud service executes the console app or process. https://azure.microsoft.com/en-us/documentation/articles/fundamentals-introduction-to-azure/
Azure Website Jobs - https://azure.microsoft.com/en-us/documentation/articles/web-sites-create-web-jobs/
I think website jobs is what you really are looking for. Build a little powershell or EXE of what you want doing then set it on a website job with a schedule. I don't think there is really much advantage either way, if you are already in the azure cloud this is just another service to leverage. We currently use both jobs and worker roles. Worker roles have the advantage of scaling out if needed.
I have an existing product that runs in .Net 4.5.1 as a windows service. It currently hosts some WCF services for controlling and reporting on the product.
I now have a requirement to host a basic web application (ideally ASP.Net, but HTML and JS would do) within the windows service as well, for configuring the product.
We ideally don't want a separate install of a website/IIS as a requirement, so I really need to be able to do all this from the windows service itself. I will be calling into the WCF methods for some functionality, but I would ideally be able to run some .Net C# code as well.
I've looked about and all the stuff I find is for hosting web services within a windows service, or incredibly old stuff from 2010 or before.
I've looked into the ApplicationHost.CreateApplicationHost stuff, but the one tutorial I found involved adding stuff to the GAC, setting windows environment variables etc, which again, I would rather avoid and keep my stuff all fairly isolated.
I have a simple server app that I need to re-write. Basically, uses async TCPSockets to allow multiple clients to connect & communicate asynchronously. Right now it is running as a winforms app & is managed as a windows service. I'm trying to decide if I should rebuild it in a similar way using WPF, or should I rebuild as an IIS MVC4 WebAPI app. I like all of the monitoring options & memory management built into IIS. This is definitely more familiar territory to me.
I'll need a nice GUI interface to see realtime statistics but this should be do-able as a web app. Is there any reason I wouldn't use MVC4 web API?