Hi,

 

I am using <if test="${file::get-length(listFileName)> 0 and file::is-assembly(listFileName)}" failonerror="false">…</if> in my build script. If the listFileName file is locked by other process file::is-assembly(assemblyFile) fails and gives the following error:

 

NAnt.Core.BuildException: D:\Abc\Xyz.build(179,9):
            Function call failed.
            _expression_: ${file::get-length(listFileName)> 0 and file::is-assembly(listFileName)}
                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---> System.IO.FileLoadException: Can not access file 'Abc.log' because it is being used by another process.

 

 

I would like to ignore the error in <if> task (generated by test condition) if the file is locked. I tried adding failonerror="false" but it still breaks the build.

 

Can you please tell me how to make build successful even if some files being passed to file::is-assembly(listFileName) in my <if> task are locked.

 

Thanks in advance,

 

Sandeep

Reply via email to