DeploymentItemAttribute doesn't work (correct)

I have a Unit-TestClass. To test some functions for who i need database-access, i define the DeploymentItemAttribute at the head of the class directly after the TestClassAttribute.

For some reasons, running the Testclass shows very different beheaivor depending on if i run all the test of my TestProject or Testing only this units by pressing STRG+R, T.

By using CTRL+R, T, all tests of the class will succeed. By running all the tests of the testproject, they will fail because they can't find the file. By right-clicking on the Testclass in the solution-explorer and click "Run Unit-Tests", they will also fail.

I configured the file correctly. It will "always copy". More strangely, switching the deployment-flag in the testconfigurations will also invert the results.

Answers


Relying on my memory I can tell that by using CTRL+R, T you invoke default Microsoft's test runner, which deals with DeploymentItemAttribute as one would expect. But when you say:

By running all the tests of the testproject, they will fail because they can't find the file. By right-clicking on the Testclass in the solution-explorer and click "Run Unit-Tests", they will also fail.

I'm more then sure that these commands are provided by ReSharper, hence tests are run using ReSharper's test runner, which in the past had issues with this attribute.

As for the solutions to this problem there are some mentioned here and here, but they might depend on the version of ReSharper so you might want to google it up for your specific version.


Need Your Help

Disable Days in Jquery FullCalendar

jquery date fullcalendar

I'm using FullCalendar as a large date picker with added features, and need to disable all Sundays and various other days throughout the year. Jquery UI date picker allows you to create methods for

Is there any javascript event fired when the on-screen keyboard on mobile safari or chrome opens?

javascript android ios on-screen-keyboard

I try to react to the on-screen keyboard in our web applications. Unfortunately there are some things complicating this: