Steve Clements

.Net and then some....


News

Search



MCP

Add to Google
Add to Technorati Favorites



Subscribe to this Blog by Email


this is Steve's profile
Locations of visitors to this page

My Stats

  • Posts - 121
  • Comments - 124
  • Trackbacks - 52

Twitter












Tag Cloud


Recent Comments


Recent Posts


Archives


Post Categories


Image Galleries


Fav Blogs


Fav Places


Services!


Top Kudos



Now that is a bad ass title!!

Anyone who has been through the MindSharp training course for SharePoint and any others that have looked at any code Todd Bleeker puts out there will most certainly be aware of using post build scripts in Visual Studio to deploy your sharepoint project.  This knowledge is of course not limited to MindSharp grads, its just that being one I know what they know!

To get them to work in a Windows 2008 and Visual Studio 2008 environment you will need to make some changes.  As pointed out here, GacUtil has moved so the command will change from

this

"%programfiles%\Microsoft Visual Studio 8\SDK\v2.0\Bin\GacUtil.exe" /if "$(TargetPath)" /nologo

to this

"%programfiles%\Microsoft SDKs\Windows\v6.0A\bin\GacUtil.exe" /if "$(TargetPath)" /nologo

...and the command to recycle the app pool in IIS7 has changed, if you try the old way you will most likely get a Microsoft.CmdLib error when building from VS.  The required command has changed from

this

"%systemroot%\system32\iisapp.vbs" /a "[YourAppPool]" /r

to this

"%systemroot%\system32\inetsrv\APPCMD" recycle apppools "[App Pool Name]"

This is as much for me as everyone else as I no doubt will come up against this again!

For completeness here is my postbuild script for a custom field project, you might not want to copy the debug pdb file or create a solution (last two commands)

cd "$(ProjectDir)"

"%programfiles%\Microsoft SDKs\Windows\v6.0A\bin\GacUtil.exe" /if "$(TargetPath)" /nologo

"%systemroot%\system32\inetsrv\APPCMD" recycle apppools "App Pool Name"

xcopy "TEMPLATE" "%CommonProgramFiles%\Microsoft Shared\web server extensions\12\TEMPLATE\" /ys

xcopy "$(TargetDir)*.pdb" "%systemroot%\Assembly\GAC_MSIL\OC.Sharepoint.FieldTypes\1.0.0.0__[token]\" /ys

MakeCab.exe /f FileName.ddf


posted @ Monday, June 09, 2008 6:49 PM | Filed Under [ Sharepoint Visual Studio ]

Comments

No comments posted yet.
Post a comment





 

Please add 8 and 8 and type the answer here: