Daily Usage Issues

NCrunch 2.23.0.2 continually prompts me to 'Save As' any open source files

Started by SteveDunn on 5,177 views

Recently, when I close a source file, VS asks me to 'Save As', even though the file is part of my project. It also happens when I do a refactor in ReSharper or when I build the solution. When I press Save in the Save As dialog box, sometimes it saves and sometimes it says 'Cannot create a file when that file already exists'.

If I turn off NCrunch, the problem goes away.

I had this in the last version of NCrunch too - I updated to 2.23.0.2 to see if it fixed it, but it doesn't.

Any ideas? Unfortunately, I'm not in a situation to post my solution, but it's a C# .NET 4.5.2 solution consisting 7 projects, 2 are shared projects, 1 is a console app, and the others are library projects.

Edited

Hi,

If I were to guess, I would say that there is a process holding a lock on your source files.

There is nothing in NCrunch that would do this directly, but because NCrunch runs your tests and builds, and leaves test/build processes around after execution has completed, it's possible that user code is opening file locks on your foreground solution and the locks are being left open.

Check for absolute file references from your code to source files in your solution.

Enabling the Terminate Test Runner Tasks When All Test Execution Is Complete may help with this problem as it will cause test processes to be recycled faster, thus dropping any locks introduced by tests.
Turns out it was Tortoise SVN (1.8.6.25415). Turning off NCrunch meant the Save As prompt (almost) completely disappeared (maybe one every 30 minutes), but with NCrunch on, it happened nearly every time I did a ReSharper Refactor or invoke a build.

Kill the Tortoise SVN process (TSVNCache and TortoiseProc) meant that these Save As prompts disappeared fully.
Thanks for confirming! Maybe check if Tortoise have a fix for this .. I've usually found this project to be fairly reliable (historically anyway).

Post a reply

Log in to reply.