Ho Do I Restart Sitecore Server From Code?

266 Views Asked by At

We have a requirement to install Sitecore packages programmatically from a custom admin page. The package installation is working but once the package is installed I wanted to restart the Sitecore server from code.

Sitecore.Install.Installer installer = new Sitecore.Install.Installer();

I tried with installer.ExecutePostStep but not sure what action I need to provide to this function. If anyone has done it before Please help .

Basically I wanted to execute the functionality from code what the two below check boxes are doing when we do manual installation.

enter image description here

1

There are 1 best solutions below

0
Kate Orlova On

The easiest thing will be to restart the Sitecore's application pool by a Restart-Application PowerShell command.

Find more details here.