0

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

Deb
  • 391
  • 2
  • 20
  • https://stackoverflow.com/questions/249927/restarting-recycling-an-application-pool – Marek Musielak Sep 13 '21 at 11:09
  • Thanks for your reply @Marek Musielak. I found that Sitecore installer class has many static method and there is one method to restart the server. Sitecore.Install.Installer.RestartServer();. I am yet to to test but this should work I guess. – Deb Sep 13 '21 at 12:23

1 Answers1

2

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

Find more details here.

Kate Orlova
  • 3,225
  • 5
  • 11
  • 35