Last post Apr 03, 2018 10:58 AM by JAYHAWKER
Apr 02, 2018 04:52 PM|JAYHAWKER|LINK
I have to manually stop a website I am trying to update, then publish the app to the site, then restart the website again when publishing to IIS. If I don't, then it often won't publish. This gets to be very cumbersome.
Can I set a flag to force it to overwrite the files, can I programmably stop and restart the site?
Apr 03, 2018 03:09 AM|Brando ZWZ|LINK
As far as I know, if you use web deploy, it will take an application offline by using the "AppOffline" rule, which is off by default.
I suggest you could try to use msdeploy command to publish the web application.
Besides, if you want to programmably stop the IIS application, I suggest you could use
The Microsoft.Web.Administration (MWA) APIs are built as a managed code wrapper over the Application Host Administration API (AHADMIN) which is a native code interface library. It provides a programmatic way to access and update
the web server configuration and administration information.
More details, you could refer to below answer:
Apr 03, 2018 10:58 AM|JAYHAWKER|LINK
Thanks for the reply. It does take it offline when publishing to a production server, but not my local IIS. I'll do the "Mark as Answer" for you after a little more time to see if any others have ideas.