I'm working on web API project. I have written unit tests and i am using Nunit to run these tests. I encountered this strange error.

I opened Nunit.exe and under Project > Add Assembly i specify my dll which has unit tests. I click Run and tests execute fine.

I go back to Visual Studio 2015 and make some edits to my tests and Build. It says,

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. 

When i close NUnit application, build works fine.

But this was not the case a few hours back. Whenever i click Build in VS2015, in Nunit GUI it used to display Reloading.. and the dll used to reload.

I have to close Nunit > Build in VS > Open Nunit > Add assembly reference > Run to run my test cases. Has anyone faced the same isuue?

1

There are 1 best solutions below

2
CallMeLeonardo On BEST ANSWER

You have to move your nunit project to the same location as the dll files are. I heard that it has to do with the shadow copy.

Here are some places, where a similar question has been asked.

Link 1 Link 2