Sunday, March 27, 2011

Iterative Development Creates a Ton of Unwanted web.config Backup Files

Whenever SharePoint modifies the web.config file, it creates a backup copy with a BAK extension as shown in figure below:

image

These backup files can be helpful on the occasion a previous version of the web.config is needed. However, when you deploy SharePoint assets using MS Visual Studio for iterative development, they can accumulate a ton of unwanted files.

The following steps teach you how to run DOS command after each successful deployment will keep the web application IIS home directory much tidier.

  • Select the SharePoint node, as shown in figure below:

image

  • Type the following into the “Post-deployment Command Line” textbox:

DEL C:\inetpub\wwwroot\wss\VirtualDirectories\[WebApplicationHomeDirectory]\*.bak

Replace [WebApplicationHomeDirectory] with the actual file system directory that IIS refers to as the web application’s home directory.

  • Just below the Post-deployment Command Line, verify that the Default option is selected in the Active Deployment Configuration drop-down.

No comments: