I originally gave you instructions to ensure that Deployment was enabled in your test settings. You said that it was.
Make sure that you have deployment enabled for the test run.
- Edit your
.testsettings
in the Solution Items folder
- Select the Deployment category
- Check the "Enable deployment" option
- Click "Apply" and "Close"
However, since last time I answered, I learned that the DeploymentItem
attribute only targets methods (and then, it seems only works on TestMethod
s). It could never have worked the way you have it decorating a class
. I also noticed your comment on your question (edited for grammar)
Yes, the items are set to Copy Always
, otherwise the DeploymentItem
in the project test run wouldn't work.
There's a lot of discussion whether this is necessary or not to make DeploymentItem
work. I suspect that something we haven't identified yet is making tests pass when running them from the project. Please remove the DeploymentItem
s completely and try your two test runs (from project and from solution) and see what results you get.
In Case Deployment Items are Working Despite the Documentation
Make sure that ReportEngine.config
and ReportFiles\
are where you and MSTest expect them to be. Relative file paths are resolved starting at the "RelativeRootPath". By default, that's the $(SolutionDir)
. Unless you override it in the testsettings
. Please check on that.
But, by default
[DeploymentItem("ReportEngine.config")]
is expanded to something like
[DeploymentItem("$(SolutionDir)\ReportEngine.config")]
then, for example, to
[DeploymentItem("D:\code\my-project\ReportEngine.config")]