Resharper Unit Test Runner Can't Find Content

2019-02-16 13:37发布

问题:

I have some tests that rely on some files I have marked as "Content" and to "Always Copy". I'm using the DeploymentItem attribute to make sure they get copied to the output directory when running mstest outside of VS. However when using the Resharper test runner inside VS these files never make it to the directory that it is executing from. Anyone know how to fix this?

回答1:

Disabling the Unit Testing > Shadow-copy assemblies being tested Resharper option fixed this problem for me.



回答2:

We solved this problem by marking the test files as embedded resources and then used a utility method to read the embedded resource and write it to the expected location.