Daily Usage Issues

NCrunch locks folders

Started by ernow on 7,857 views

First of all: great work! I really like this and can't help but wonder why Microsoft did not include it.

I noticed a 'bug': when NCrunch is running it is impossible to rename a folder in a project.

A 'work-around' is to temporarily disable NCrunch.

Edited

Hi, thanks for posting and I'm glad your enjoying NCrunch!

NCrunch will only perform builds and run tests within a workspace it has created for itself, so if you're experiencing file locking problems inside your solution, there is a high likelihood that you have absolute file path references somewhere in your solution that are pointing to a fixed part of your drive (and within the folder you are trying to rename).

When using NCrunch, make sure that ALL file references within your source code are using relative paths. One way you can test for this is by closing down your IDE, renaming your solution folder, then reloading your IDE and trying to build/run tests.
Here is how to reproduce what I am seeing:
[list=1]
  • Create a new Solution (console project)
  • Enable NCrunch (background threads: 1, run tests in parallel, run tests automatically, let my tests run)
  • Add a folder named Folder1
  • Add a subfolder to Folder1 named Folder2
  • Add a class to Folder2 named Class1
  • Try to rename Folder1

  • Fix:
    [list=1]
  • Disable NCrunch
  • Rename folder
  • Enable NCrunch
  • Edited

    Thanks, I've been able to reproduce the problem perfectly using the steps you've described above. It looks as though the methods NCrunch is using to watch files are interfering with nested rename operations.

    I'll have a deeper look into this to see what I can do.


    Cheers,

    Remco

    Post a reply

    Log in to reply.