Whenever SharePoint modifies the web.config file, it creates a backup copy with a BAK extension as shown in figure below:
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:
- Type the following into the “Post-deployment Command Line” textbox:
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.