Skip to content

csproj: Add option to ignore sub folders that contain a .csproj file. #4758

@rs-blade

Description

@rs-blade

Steps to reproduce

I've got a project structure where projects may reside in a sub folder of another project. By this the directory structure reflects the namespace and assembly name structure. One common case (but not the only) for this are the test projects.
So I maybe have:

  • Foo/
    • Abc.cs
    • Foo.csproj
    • Tools/
      • Def.cs
    • Test/
      • Foo.Test.csproj
      • AbcTests.cs
      • ToolsTests/
        • DefTests.cs
    • Bar/
      • Foo.Bar.csproj
      • Ghi.cs
      • Test/
        • Foo.Bar.Test.csproj
        • GhiTests.cs

Expected behavior

There is an option that tells msbuild to automatically exclude all sub folders that contain *.csproj files.
So when building Foo.csproj nothing from Test, Bar or Bar/Test sub folders will be built but the content of Tools will be build. When building Bar/Foo.Bar.csproj nothing from Bar/Test will be build.

Actual behavior

At the moment I have to explicitly exclude Test and Bar from Foo.csproj and Test from Foo.Bar.csproj.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions