Question BG Task running non-stop on iis, is it possible?

maniac21

New member
Joined
May 17, 2021
Messages
2
Programming Experience
1-3
like signlr, we have something listening for connections. can we've a BG task running nonstop on iis hosted mvc app.
 
If you want something like SignalR then why would you not just use SignalR? Maybe you don't actually want something like that at all.

I suspect that what you want is a Web API, which is basically an MVC app without the V. You create an ASP.NET application project the same way but, instead of MVC, you choose Web API. You then create a model and controllers in basically the same way but, instead of views, your controller actions return data, often as JSON. Anything with web access can then connect to your API, including an MVC app. Where you might otherwise create your service layer as part of an MVC app, you can create it as a Web API instead, then have both the MVC app and other applications, e.g. mobile apps, connect to that common service for their data.
 
If you want something like SignalR then why would you not just use SignalR? Maybe you don't actually want something like that at all.

I suspect that what you want is a Web API, which is basically an MVC app without the V. You create an ASP.NET application project the same way but, instead of MVC, you choose Web API. You then create a model and controllers in basically the same way but, instead of views, your controller actions return data, often as JSON. Anything with web access can then connect to your API, including an MVC app. Where you might otherwise create your service layer as part of an MVC app, you can create it as a Web API instead, then have both the MVC app and other applications, e.g. mobile apps, connect to that common service for their data.
you didn't got my point. let me explain.

I have build a console application which is actually a CronJob. In this app, a task runs continuously and check jobs_array(job_time) which job has to be executed at that moment.
I have an asp.net application(mvc/api). and I want that cronjob Task running in background continuously that just works like Task running in console application.
 
What's wrong with using the Windows Task Scheduler or writing a Windows service instead? Why do you need to run off IIS?

If you really must hang off IIS. Use Hangfire.
 
Back
Top Bottom