"Could Not Copy Temporary Files to the Output Directory" and big VS.NET projects
A fellow emailed me about the troubles he was having with his VS.NET solution. He's trying to build into a shared binaries folder and is using direct Assembly references (rather than project references.)
In fact, it appears that Intellisense is locking his assemblies just long enough to get one of the dreaded:
- Could not copy temporary files to the output directory.
- The file 'assembly name' cannot be copied to the run directory. The process cannot access the file because it is being used by another process.
- error CS0016: Could not write to output file 'fully qualified path of an assembly' -- 'The process cannot access the file because it is being used by another process. '
- Cannot delete the project output: is the file read-only? A failure occurred while attempting to start the application.
And that sucks. Basically if you turn Copy Local to False and compile to one folder, you're screwed.
The moral? We use NAnt for all builds. It's fairly simple, repeatable, and IJW. Otherwise, if your goal is to get all files to a shared bin, use a Post Build Event.
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
Hope this helps someone. I'm not totally sure it applies here, but it sounds like the same issue I've had before.
Anyway, NAnt does rock! We use it for our build process, but not for debugging applications. We haven't gotten to VS integration with it (yet!).
Joel
Comments are closed.
I don't know if you guys are doing it, but my team uses a pretty handy little trick to kick off nant from within VS.NET: Tools -> External Tools. We just kick nant.exe with the right arguments and redirect the output to the VS Output window. You can even click on the compilation errors and jump to the appropriate part of the source code. Plus, you can do other fun things in the build file, like automatically kick off nunit, but I won't go into that. :)
What technique do you folks use to integrate NAnt into VS?