Windows Service (edit)

  • Windows.Forms applications
  • Using a System.Windows.Forms.Timer (not System.Threading.Timer) to peform GUI updates is also a good solution.
  • Let xxx run in background

Idea

https://stackoverflow.com/questions/11027051/develop-a-program-that-runs-in-the-background-in-net

Source Code

https://github.com/UweKeim/SimpleBackup

https://github.com/MscrmTools/MscrmTools.Iconator (Manage custom entities icons in a single screen)

https://github.com/IBM/HTTP-BlackOps

https://github.com/IBM/HTTP-BlackOps/tree/master/CustomTestsUI

https://github.com/sunpander/YYERP

https://github.com/Autodesk/synthesis

https://github.com/Gangleider/WorkSoap

Windows Service

https://www.howtogeek.com/school/using-windows-admin-tools-like-a-pro/lesson8/

https://www.howtogeek.com/50364/convert-a-batch-bat-script-to-an-executable-exe-file/

https://stackoverflow.com/questions/3243348/how-to-call-a-method-daily-at-specific-time-in-c (HAY HAY HAY)

https://stackoverflow.com/questions/246697/best-timer-for-using-in-a-windows-service (HAY HAY HAY)

Both System.Timers.Timer and System.Threading.Timer will work for services

Task Scheduler

https://www.calazan.com/windows-tip-run-applications-in-the-background-using-task-scheduler/

https://www.codeproject.com/Articles/2407/A-New-Task-Scheduler-Class-Library-for-NET

Background Jobs

https://docs.microsoft.com/en-us/azure/architecture/best-practices/background-jobs

Set CPU Process Priority Applications in Windows 10

https://www.tenforums.com/tutorials/89548-set-cpu-process-priority-applications-windows-10-a.html

How to launch apps automatically during startup on Windows 10

https://www.windowscentral.com/how-launch-apps-automatically-during-startup-windows-10

Background Worker

https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.backgroundworker?view=netframework-4.5

https://devtut.github.io/csharp/backgroundworker.html

https://carldesouza.com/c-using-backgroundworker/

https://viblo.asia/p/backgroundworker-trong-ung-dung-c-windows-form-naQZRGy0lvx

Backgrounder

https://code.google.com/archive/p/backgrounder/

.NET Framework 4.0

https://www.codeproject.com/Articles/106742/Creating-a-simple-Windows-Service

.NET Core 3.0

https://codeburst.io/create-a-windows-service-app-in-net-core-3-0-5ecb29fb5ad0

How to run background task in Outlook 2007 add-in efficiently?

  • OOM: Office Object Mode
  • OOM: Outlook Object Mode
  • COM: Component Object Model (COM)
  • VSTO Outlook Multi threading
  • VSTO Outlook Addin
  • VSTO Addin for Outlook
  • MAPI: Messaging Application Programming Interface
  • EWS: Exchange Web Services

https://stackoverflow.com/questions/2456483/how-to-run-background-task-in-outlook-2007-add-in-efficiently

https://stackoverflow.com/questions/47312985/vsto-outlook-multithreading

https://stackoverflow.com/questions/29931477/vsto-outlook-add-in-does-ui-manipulation-need-to-be-done-from-main-thread

https://stackoverflow.com/questions/29315558/vsto-with-windows-form-and-worker-threads/

https://docs.microsoft.com/en-us/visualstudio/vsto/how-to-programmatically-send-e-mail-programmatically?view=vs-2017

https://www.pluralsight.com/guides/how-to-write-your-first-multi-threaded-application-with-c

For Console Application - Processing jobs in a console application

https://docs.hangfire.io/en/latest/background-processing/processing-jobs-in-console-app.html

For ASP.NET

https://www.hanselman.com/blog/HowToRunBackgroundTasksInASPNET.aspx

https://www.hangfire.io/

https://www.mikesdotnetting.com/article/254/scheduled-tasks-in-asp-net-with-quartz-net

Installing windows service using installutil.exe in visual studio command prompt

Installing windows service using installutil.exe in visual studio command prompt - Dotnet Learners

To install windows service using installutil.exe in visual studio command prompt follow the below steps

To install service:

  • Open visual studio command prompt as run as administrator
  • Type cd %systemroot%\Microsoft.NET\Framework\v4.0.30319\    -> and click enter
    Note: you may need to change the framework version based on VS you have
  • Type installutil SERVICE PATH
  • Example:
    installutil F:\Delete\SampleSolution\Sample\WindowsServiceExample\bin\Debug\WindowsServiceExample.exe

To un install service:

  • Open visual studio command prompt as run as administrator
  • Type cd %systemroot%\Microsoft.NET\Framework\v4.0.30319\    -> and click enter
    Note: you may need to change the framework version based on VS you have
  • Type installutil -u SERVICE PATH
  • Example:
    installutil -u F:\Delete\SampleSolution\Sample\WindowsServiceExample\bin\Debug\WindowsServiceExample.exe

Note:

Instead of opening visual studio command prompt every time and typing all these commands, you can create separate windows command prompt cmd files and open them as run as administrator

Example:

To Install -> install.cmd file:
%systemroot%\Microsoft.NET\Framework\v4.0.30319\installutil F:\Delete\SampleSolution\Sample\WindowsServiceExample\bin\Debug\WindowsServiceExample.exe
pause

Example:

To Un Install -> uninstall.cmd file:
%systemroot%\Microsoft.NET\Framework\v4.0.30319\installutil F:\Delete\SampleSolution\Sample\WindowsServiceExample\bin\Debug\WindowsServiceExample.exe
pause