System.IO.IOException: The process cannot access the file because it is being used by another process.

May 11, 2011 at 11:46 PM

Hello,

I am using SharpArch within a Visual Studio 2010 project to generate code for simple CRUD operations.  The project has grown and we are generating quite a few objects now.  When I try to generate all objects I get this error

Error    35    An Exception was thrown while running the transformation code. The process cannot continue.  The following Exception was thrown:
System.IO.IOException: The process cannot access the file because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.__Error.WinIOError()
   at System.IO.File.Move(String sourceFileName, String destFileName)
   at T4Toolbox.DteProcessor.UpdateOutputFiles(IEnumerable`1 outputFiles, Solution solution, IEnumerable`1 projects, ProjectItem template)
   at T4Toolbox.DteProcessor.UpdateFiles(ICollection`1 outputFiles

If I restart VS and comment out about half of the entities, It will run without errors. 

Anybody know what to do to fix this issue?  It has become an huge headache.

Thanks so much

Coordinator
May 12, 2011 at 1:13 AM

Is your solution under source control? If yes, what is it?

May 12, 2011 at 3:31 AM
Yes, we use Subversion with an Ankh svn plugin for VS.
May 12, 2011 at 9:22 PM
After removing the .svn linkages, the error goes away! I don't quite understand how the generator was able to create some objects and not all though. I would love to hear the explanation if anyone has it. Otherwise, thanks a lot for the assist!