I have a web deployment project that is misbehaving. I have inherited an App_Data folder that contains a substantial number of .pdf files. Some of the filenames include invalid characters and are overly long. In my deployment project file I include the following ItemGroup at the end:
...
<ItemGroup>
<ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*.pdf" />
</ItemGroup>
</Project>
But when I build the project I keep getting the following error:
error : Copying file $([System.IO.Path]::Combine($(_WDPSourceWebPhysicalPath),
App_Data\CWM2\393S097 Connection of an Embedded Network to elided's Network v1.pdf))
to obj\Debug\Source\App_Data\CWM2\393S097 Connection of an Embedded Network to
elided's Network v1.pdf failed. The path is not of a legal form.
I've tried adding wildcards to the App_Data folder but it's just not working. I guess it's conceivable that msbuild is unable to match those files for exclusion because the filename is invalid. Help?
I've seen a similar bug with my deployment project. I believe that VS2010 Web Deployment Projects has a bug that prevents copying any file that contains a quote character.
I filed a connect bug here: https://connect.microsoft.com/VisualStudio/feedback/details/631995/
The only workaround I know is to remove the quote character from the name of the file.