I have a Web Site project that is deployed using "Publish Web Site" feature in Visual Studio. I understand this feature uses WebDeploy (MSDeploy) which calls MSBuild to compile the site.
There is a directory within the website that needs to be ignored by both WebDeploy and MSBuild because it breaks the site.
I was able to configure the deployment configuration file (.pubxml) to make WebDeploy ignore directory:
<PropertyGroup>
...
<ExcludeFoldersFromDeployment>node_modules</ExcludeFoldersFromDeployment>
</PropertyGroup>
I was also able to get the site to compile by making the directory hidden in the file system.
However, I am unable to get MSBuild to ignore the directory when called from WebDeploy.
How do I ignore the directory anytime the site is compiled?
Update
The compiler logs this in the Output Window when it fails:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.WebSite.Publishing.targets(172,5): Error MSB4018: The "CollectFilesinFolder" task failed unexpectedly.