Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS site and nant/nantcontrib?

is it possible to manage IIS web applications with NAnt? For example stop or start it?

like image 753
Andrey Selitsky Avatar asked Dec 22 '22 12:12

Andrey Selitsky


2 Answers

Nant has the servicecontroller task with which you can either stop/start just the Web server or entire IIS, i use it generally to just stop/start the web server.

<servicecontroller action="Stop" service="w3svc" 
   timeout="10000" verbose="true" />

Documentation available at http://nant.sourceforge.net/release/latest/help/tasks/servicecontroller.html

like image 83
Dinesh Manne Avatar answered Mar 16 '23 07:03

Dinesh Manne


Maybe you can use exec task to execute

iisreset -stop
iisreset -start

EDIT : And this VBS might help for stopping/starting WebApplications under IIS

Here is the accespted solution to stop a website with nant task on IIS :

<target name="stopSite"> 
  <exec program="cscript.exe"> 
    <arg value="C:\windows\system32\iisweb.vbs" /> 
    <arg value="/stop" /> 
    <arg value="test" /> 
  </exec> 
</target>
like image 37
Canavar Avatar answered Mar 16 '23 08:03

Canavar