Why MSTest does not copy referenced project libraries?

有些话、适合烂在心里 提交于 2019-11-30 17:35:13
amaters

So I have found this article: https://web-beta.archive.org/web/20140803214948/http://www.dotnetthoughts.net:80/mstest-exe-does-not-deploy-all-items/

Seems an mstest issue.

Because i just had the same issue I figured a way to fix it. In my case the referenced dll's where never actually used directly from the testproject (altough they were used by using reflection). To solve it I added a testclass with the following code:

[AssemblyInitialize]
    public static void InitializeReferencedAssemblies(TestContext context)
    {
        ObjectInAssemblyX dummy = new ObjectInAssemblyX();
        ObjectInAssemblyY dummy2 = new ObjectInAssemblyY();
    }

Now they are used so they will be copied

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!