【问题标题】:VS2015 : NUnit : Could not copy 'source dll localtion' to 'destination dll localtion'. Exceeded retry count of 10. FailedVS2015:NUnit:无法将“源 dll 位置”复制到“目标 dll 位置”。重试次数超过 10。失败
【发布时间】:2017-04-13 08:19:45
【问题描述】:

我正在开发 Web API 项目。我已经编写了单元测试,并且正在使用 Nunit 来运行这些测试。我遇到了这个奇怪的错误。

我打开了 Nunit.exe,在 Project > Add Assembly 下我指定了包含单元测试的 dll。我单击运行,测试执行良好。

我回到 Visual Studio 2015 并对我的测试和构建进行一些编辑。它说,

Could not copy 'location/of/dll'. Exceeded retry count of 10. Failed.
The process cannot access the file 'location/of/dll' because it is being used by another process. 

当我关闭 NUnit 应用程序时,构建工作正常。

但几个小时前情况并非如此。每当我在 VS2015 中单击 Build 时,在 Nunit GUI 中它曾经显示 Reloading.. 并且用于重新加载的 dll。

我必须close Nunit > Build in VS > Open Nunit > Add assembly reference > Run 才能运行我的测试用例。有没有人遇到过同样的问题?

【问题讨论】:

    标签: c# dll visual-studio-2015 nunit-2.5.9


    【解决方案1】:

    您必须将您的 nunit 项目移动到与 dll 文件相同的位置。 听说跟影子副本有关。

    这里有一些地方提出了类似的问题。

    Link 1 Link 2

    【讨论】:

    • 感谢您的链接。我会尝试将项目放在同一位置。当我问这个问题时,我没有得到关于这个问题重复的建议。 :D
    • 你会知道我是否接受了它作为答案.. :D
    猜你喜欢
    • 2021-12-10
    • 2017-04-24
    • 2016-08-17
    • 2016-09-22
    • 1970-01-01
    • 1970-01-01
    • 2011-12-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多