Eric
Eric

Reputation: 19873

NUnit locks my executable so that I can't recompile it

When I load my executable in NUnit, the application appears to be "locked". I run the tests but when I want to make some modifications to them, I have to close NUnit first otherwise my compilation will fail.

Is there any workaround for this?

EDIT

According to Process Explorer, the only process accessing my executable right now are "nunit-agent.exe" and "nunit.exe"

Upvotes: 2

Views: 863

Answers (2)

Kumaresan Lc
Kumaresan Lc

Reputation: 281

Move the test project to the folder or a relative folder to where you kept the executable files.

or Create new test project in the corresponding folder

Upvotes: 0

adrianbanks
adrianbanks

Reputation: 82994

Check that you have "Enable Shadow Copy" enabled in NUnit's options (Tools -> Settings -> Test Loader -> Advanced). With this option enabled, NUnit works with a copy of your assembly, not the original compiled version. This means that you can edit and recompile assemblies while NUnit is still running.

If you also enable "Reload when test assembly changes" (Tools -> Settings -> Test Loader -> Assembly Reload), NUnit will notice that you have recompiled and automatically reload your new assembly.

Upvotes: 9

Related Questions