Instead of relying on your website code to manage routine tasks, you may want to move regular routines into their own scheduled task that executes periodically.
Follow this guide on how to create a scheduled task that you can upload to your server.
- Open Visual Studio and create a new Project of type Console App
- Replace the contents of the Program.cs file with the below.
The code writes the current data and time to a text file called TaskBlip.txt
(You can expand this later to include your own routines as required.)
string docPath = Environment.CurrentDirectory;
using (StreamWriter outputFile = new StreamWriter(Path.Combine(docPath, "TaskBlip.txt"), true))
{
outputFile.WriteLine(DateTime.Now.ToString("yyyyMMdd HH:mm:ss"));
} - Run the code locally to ensure it creates the text file.
(Because the file is written to the current directory, you'll find it in /bin/Debug/net9.0 - Now right-click on your Project and select Publish.

- Select Folder as the Target and click on Next.

- Select Folder again and click on Next.

- Set the path to publish to (the default is fine), and click on Next.

- Click on Close to complete the Publish profile creation

- Now we need to edit the Publish Profile further, click the pencil icon on the Target Runtime.

- Change the Deployment mode from Framework-dependent to Self-contained.

- Set the Target location to win-x64

- Click on Save
- Now, click on the Publish button

- Your project will compile and then be published:

- Once complete, click on the Navigate link to open the publish folder:

- You will now see all of the files required to run your console app.
In the File Explorer toolbar, click on the Up Arrow icon:
- And you will now see the win-x64 folder:

- We need to upload this folder to your Plesk account, so log in to Plesk and click on the Files icon:

- We recommend you keep all of your scheduled tasks outside of your website's folders.
In the Plesk File Manager, click on Home Directory to select the top level of your hosting account:
- Now, click on the blue plus icon and select Create Directory:

- Set the Directory name to tasks and click on OK:

- Select your new tasks folder in File Manager:

- Click the blue plus icon again, and this time select Upload Directory:

- Drag your win-x64 folder from your Windows file explorer window onto the drop area in your browser:

- Wait for all of the files to upload to the server:

- The window will close automatically once the upload is complete.
- Rename the win-x64 folder to a better name, like the name of your task.
For this guide, we renamed win-x64 to TaskTest
- Go back to the main screen of Plesk and click on the Scheduled Tasks icon under your website's Dev Tool.s

- Click on the Add Task button

- You will need to know the full path of your uploaded task for the next step.
The path will be:
C:\inetpub\vhosts\domainname\tasksfolder\taskname\taskexe.exe
Where:
domainname is the Plesk-hosted domain. (In our screenshots, you will see it's blazor.uptimewebhosting.com.au, replace this with your domain name from Plesk)
tasksfolder is the new folder you created in step 21 above
taskname is what you renamed the win-x64 folder to in step 27
taskexe.exe is the name of your executable file, which you uploaded in step 25 - On the Schedule a Task screen, set the following:
TaskType: Run a command
Command: the full path to your task (Step 30)
Run: The frequency you'd like to task to run.
Description: The name of the task as you'd like it to appear in Plesk
- With the run frequency, you can choose to use a Cron-style schedule for a more frequent time period.
In the example above, we set this task to run every 10 minutes by using:
0,10,20,30,40,50 * * * *
Be cautious when setting these values, as running heavy-load tasks frequently may overload your server's resources, negatively impacting your website's performance. - Click on the Run Now button to check your settings. Plesk will do a test run:

- If everything works as expected, you will see a completed notification:

- Click the OK button to save your task.
- Your scheduled task is now set up and running.
Updating your code
If you need to update your code, it's a good idea to edit the Scheduled Task and untick the Active checkbox:
This will ensure the task doesn't run while you are uploading your new files.