Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

NCrunch seems to occasionally lock folders in projects making the folders impossible to rename
ljohnston
#1 Posted : Tuesday, June 10, 2014 10:55:05 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 1/17/2014(UTC)
Posts: 31

Thanks: 17 times
Was thanked: 5 time(s) in 5 post(s)
Sometimes while working with a project that has NCrunch enabled if I attempt to rename a folder I'll get the Visual Studio message: "Cannot rename 'MyFolder'. The process cannot access the file because it is being used by another process.

If I use LockHunter to see which processes have the folder locked it will show that devenv.exe (the instance with the project loaded) has the folder locked.

I believe it's actually NCrunch that's locking the folder because if I disable NCrunch then the lock immediately goes away. When I re-enable NCrunch the lock comes back.

NCrunch doesn't seem any given folder all the time, but when it does lock them it seems to do so for an arbitrarily long time, meaning I have to disable NCrunch if I want to rename the folder. I'm not sure what causes it to lock or not lock a folder. It seems to happen pretty regularly, but not all the time (often enough to be quite frustrating, not often enough to claim I can easily reproduce it for you).

This is particularly frustrating if I'm using git for source control, because switching to a branch will often involve renaming/adding/deleting folder(s) within a project, so when this issue occurs it makes it impossible to switch branches without disabling NCrunch first. (To be clear I'm seeing this even attempting to rename the folders manually in VS, not only when git is attempting to make changes.)

Could this be a bug in NCrunch? If it could be, is this enough information to track it down? If there's additional information you need I'll try to provide it. I can't provide the entire projects I'm currently working with.
Remco
#2 Posted : Tuesday, June 10, 2014 11:01:16 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Yes - this is a known issue. It is tied to the method NCrunch is using to watch for file changes inside these folders.

The problem can be reproduced by attempting to rename a project sub-folder that contains other folders. It won't happen for folders that don't contain other nested folders.

A fix is planned. To work around the problem, simply temporarily disable the engine (as you've described).
1 user thanked Remco for this useful post.
ljohnston on 6/10/2014(UTC)
ljohnston
#3 Posted : Tuesday, June 10, 2014 11:04:22 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 1/17/2014(UTC)
Posts: 31

Thanks: 17 times
Was thanked: 5 time(s) in 5 post(s)
Thanks for the reply. A fix to this would be most appreciated. Do you anticipate the fix will make it into the next version?

Remco
#4 Posted : Tuesday, June 10, 2014 11:25:28 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
There's a bit already in the next version ... so it's tough to make promises, but I'll see what I can do.
ljohnston
#5 Posted : Tuesday, June 10, 2014 11:38:55 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 1/17/2014(UTC)
Posts: 31

Thanks: 17 times
Was thanked: 5 time(s) in 5 post(s)
Thanks. I understand you can't make any promises and I appreciate you being willing to look into it.
pratikg
#6 Posted : Wednesday, December 14, 2016 11:33:59 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/14/2016(UTC)
Posts: 1
Location: United States of America

It's been 2 years and problem still happens
Is there way to make NCrunch NOT lock any folders and still track changes?
We have an independent build system that randomly errors out because of this.
Enabling & disabling NCrunch is the last resort
Remco
#7 Posted : Thursday, December 15, 2016 12:42:15 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi,

Unfortunately, the locking of folders is a consequence of watching them for changes. My understanding is that this is an O/S level constraint. NCrunch does its best to try and watch for changes only using high-level folders, but if your solution/build structure is such that you have root level folders being changed by the build, there isn't going to be anything that NCrunch can do to avoid the locks. I'm sorry, but you will likely either need to change your solution structure or your build system to resolve this problem. I haven't yet found a way to completely fix this problem in NCrunch.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.050 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download