appcmd.exe instead of iisapp.vbs in IIS 7.0

Oct 3, 2008 at 12:13 PM

Hi,

I'm new to developement in Sharepoint and I found this tool most valuable. However I noticed that I needed to recycle the Sharepoint application pool for each redeployment of a webpart.

I wanted to use the iisapp.vbs that is defined in the targets file for the refresh but it is no longer included in IIS 7.0

Firstly I would like to know if it is really nessecary with the recycle or if I have something configured wrong.

Secondly her is my fix using the appcmd.exe command:

1. In Microsoft.SharePoint.targets add the following in PropertyGroup replacing the dummy text with your app pool name:

<APPCMD>"C:\Windows\System32\inetsrv\appcmd.exe"</APPCMD>
<RECYCLE>$(APPCMD) recycle apppool "<name of the sharepoint app pool here>"</RECYCLE>

 

2. Add the following at the end of the commands in the redeploy target:

<Exec Command="$(RECYCLE)" ContinueOnError="false" />

3. Restart VS (maybe reopening the project is enough?)

 

Regards,

Arnstein