我正在开发 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
运行我的测试用例。有没有人遇到过同样的问题?