Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7754671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:22:08+00:00 2026-06-01T12:22:08+00:00

I wrote a custom class library for NUnit unit tests. It created a dll

  • 0

I wrote a custom class library for NUnit unit tests. It created a dll file containing my .NET IL code in the {project root}\bin\Debug\ folder. Running NUnit unit tests in this class library works fine, but if I try to compile my class library again, I get this error. NUnit isn’t releasing the lock. What is causing this? How can I prevent this from occurring?

Visual Studio error when compiling after NUnit runs for first time:

Error {error #} {class library project name} Unable to copy file {class library project root folder} + “\bin\Debug\Tests.dll” to “bin\Debug\Tests.dll”. The process cannot access the file ‘bin\Debug\Tests.dll’ because it is being used by another process.

So the only way I can change the code is to close NUnit and re-open NUnit. I’m using NUnit 2.6. It’s very annoying.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T12:22:10+00:00Added an answer on June 1, 2026 at 12:22 pm

    I found the cause. Perhaps an NUnit developer can fix this. For now, I have the workaround described below.

    If you DO NOT have your *.nunit, *.VisualState.xml (auto-generated NUnit file) and *.config (NUnit configuration file that is referenced from the Visual Studio class library using System.Configuration not NUnit’s config file setting) inside of the class library root folder, this will occur. (And my *.config file is named the same as my *.nunit file, so I have Tests.config and Test.nunit, both sharing the name “Tests”)

    So for example when I get this error, I have the following setup:

    My class library is called “Tests.csproj”. And suppose Tests.csproj is in “C:\Source\Tests\”. That would make “C:\Source\Tests\” the root of my project folder. My dll is in “C:\Source\Tests\bin\Debug\Tests.dll”. And the NUnit files described above are in “C:\Source\Tests\NUnit\”.

    When I move the NUnit files to “C:\Source\Tests\” (class library project root folder), I don’t get this issue when I try compiling Visual Studio class library project. This folder structure causing this must confuse the NUnit program.

    The reason I have a separate folder was to keep all of the NUnit files separated. After fixing this, I prefixed all of the *.nunit, *.xml and *.config files with “nunit_” so they’re all grouped together.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a windows phone 7 custom class library, in that I have
I've wrote custom model binder in project, that uses ASP.NET MVC 2. This model
I wrote my own custom namespace for a Spring based project I'm working on.
I have a class library that I have written in C#.net. I want to
I wrote a class library in C++ and successfully compiled it in Linux with
I wrote a custom Symfony (1.4) Textarea class to allow the ability to convert
Using .NET 3.5, ASP.NET, Enterprise Library 4.1 Exception Handling and Logging blocks, I wrote
In my app , i created my custom class and i am observing one
I am trying to write a custom actions class library for my WiX install
I am trying to write an Setup Project/Installer for a class library driver that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.