Search code examples
c#unit-testingdeploymentitem

DeploymentItem-Attribut for all files and folders in folder


I want to deploy all files in folders which are in a directory within a unit-test. To deploy eacht item through the DeploymentItem-Attribut is too much.

I tried something like

[DeploymentItem(".\\")]

or

[DeploymentItem("*.*")]

but both don't work.

Does anybody knows how i can deploy all files with all subfolders by the Deployment-Attribut?


Solution

  • DeploymentItemAttribute does not take a pattern to search and deploy. Read more about it here

    You need to use each of the file names for the same or create a custom attribute which takes a pattern and deploys the item to our output directory.