简体   繁体   中英

Visual Studio Ms test runner fails to find assemblies

All of my tests are failing in Visual studio. They are executed by VS Ms test runner.

The issue is that the even though the dlls are referenced in the project and copy local is set to True for them, they are not being copied to Ms test runner debug folder.

I am using a test settings file with Deployment set to true.

When I run the tests, Ms test runner creates a TestResults folder and copies contents of Debug folder into TestResults/out folder. However not all of the dlls are copied over. It is as if MS test runner only copies selective dlls and not third party libraries.

The test then fails with it cannot find the required assenbly. When I use nunit or run tests as a console application then they work. Also in test settings file, I have also tested by setting Deployment to false and Assembly location folder to my root directory and they both seemed to work.

I also tried using Deploymentitem(bin/debug) on my test class but that doesn't work.

My question is: How do I ensure that when I run my tests via Ms test runner then all the dlls in the debug folder are copied into Testresults folder? Any guidance will be appreciated.

Is there a way to force ms test runner to use the dlls?

I have run into a similar situation with Entity Framework. This link should help: EntityFramework.SqlServer (or other providers) not being copied locally

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM