Skip to content

Understanding the Clean target #2408

@jaredpar

Description

@jaredpar

Tried a recent experiment in the Roslyn repo:

> git clean -dxf .
> msbuild /t:restore /v:m /m Roslyn.sln
...
> msbuild /t:build /v:m /m Roslyn.sln
...
> msbuild /t:clean /v:m /m Roslyn.sln

My expectation is that once this is complete both my Binaries\Debug directory should be essentially empty. Possibly some directories around but all content like .dll / .exe files removed. Instead what I see is 9,000+ .dll / .exe files in my Binaries\Debug directory.

The Roslyn build is correct to our understanding and mostly devoid of hacks around build output. My mental model is Clean is the reverse of Build and hence the above should leave my build artifact free. Given that Clean doesn't actually clean, the only safe operation our devs can do for rebuild is essentially delete Binaries\Debug.

Is my mental model wrong here? Or are there likely bugs in the build that we need to track down to ensure Clean actually cleans?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions