Git Product home page Git Product logo

Comments (6)

JoshMcCullough avatar JoshMcCullough commented on July 22, 2024

This happens all the time but I, too, do not like the idea of simply "ignoring" the error. I want to ensure that everything is deleted before doing a fresh build.

from nant.

hfrmobile avatar hfrmobile commented on July 22, 2024

The "nant deleting directory" issue is really an odd problem. The only way to make it working for me was to do the delete in an own target and calling that target separately:

<target name="clean">
    <delete dir="${build.root}" if="${directory::exists(build.root)}" failonerror="true" />
</target>

Command line:
nant clean
nant build

hth, hfrmobile

from nant.

JoshMcCullough avatar JoshMcCullough commented on July 22, 2024

@hfrmobile That's what I'm doing but I still get the error randomly.

from nant.

JoshMcCullough avatar JoshMcCullough commented on July 22, 2024

Maybe I'll look into it more but it seems that the RecursiveDeleteDirectory method should basically just call Directory.Delete(path, true). Seems like there's a lot of extra code in here.... https://github.com/nant/nant/blob/master/src/NAnt.Core/Tasks/DeleteTask.cs

from nant.

kendalllister avatar kendalllister commented on July 22, 2024

I know this is an old issue, but I still get these failures - the directory reported as "not empty" is always empty when I look at it after the error occurs, and the error can be thrown three or more times on successively higher directories in the tree that Nant is trying to delete as I repeatedly execute my "build clean" target.

Is anyone else still experiencing this problem? Is there a more recent ticket I should look at?

Thanks.

from nant.

srueg avatar srueg commented on July 22, 2024

I experienced the same problem. Using System.IO.Directory.Delete(path, true); in a local build resolved the issue.

from nant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.