views:

23

answers:

0

Sometimes ExcludeFromBuild rule does not work as expected and files included in the deployment which were expected to be excluded. The reason may be sometimes modifications to the web deployment file are not saved by Visual Studio although it appears to be saved.

Reproduce:

  • Open and change the Web deployment project and add a rule for exclusion.
  • Do not save the Web deployment project
  • Click and build the web site.
  • Sometimes it seems to save the web deployment project but it does not save and does not give any warning or error. I have observed this but it did not happen always. § May be access to the file blocked somehow. § Windows Vista file indexing service blocked somehow.

Workaround:

  • Make sure that web deployment project is saved with the modification.
  • Clean the source/release and debug folders

Sample:

<ExcludeFromBuild Include="$(SourceWebPhysicalPath)\images\**\*.*" />
<ExcludeFromBuild Include="$(SourceWebPhysicalPath)\img\**\*.*" />
<ExcludeFromBuild Include="$(SourceWebPhysicalPath)\test\**\*.*" />
<ExcludeFromBuild Include="$(SourceWebPhysicalPath)\xml\**\*.*" />
<ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*.jpg" />
<ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*.swf" />
<ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*.htm" />
<ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*.html" /> 

So, did you ever encounter this problem?