Hi All

I have a little problem with (what I think is) the combination of NAnt and Nunit. I have been using Nant in combination with CCNet for a while now and until today everything ran fine. I added a few more directories to my NAnt build (each directory containing the source files for a single assembly) and suddenly my build fails. I tracked it down to a failing test. The whole build is fine, all assemblies are created and placed in the correct directory. But the tests go wrong. The specific test that fails needs to create a directory before testing and then deletes that directory after the test is finished. Well it tries to and the result is this:

TearDown : System.UnauthorizedAccessException : Access to the path "0.dll" is denied.

In this case the 0.dll file is in the directory that I try to delete. Strangely enough this only happens when I run the tests with the NUnit task inside Nant. If I run the NUnit tests directly through the NUnit GUI then there are no problems. And also there are a few other tests that run normally while they perform exactly the same setup and teardown (well not exactly the same but they also create a directory, dump some files in it and when finished delete the directory). I tried both Directory.Delete(directoryName,true) and DirectoryInfo.Delete(true). And most of the time it works except for this stupid case.

As far as I can find in the documentation (MSDN documentation that is) the UnauthorizedAccessExceptoin occurs when the file/directory is readonly (which it is for some dark reason). I tried setting the directory attribute to normal. But that doesn't really help.

In short I do not believe this is related to my build file because I haven't changed that for a while now and it worked before. So the only thing I can think of is that the directory is set to read only somewhere which is kinda funny.

If there is anybody who can give me some hints on how to fix this one I would be gratefull as it's driving me nuts.

Regards Petrik

Oh right I am using:

NAnt 0.85 nightly 05-24
NUnit V2.1.4
.NET V1.1
WinXP pro


------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click _______________________________________________ Nant-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to