dotnet / dotnet/msbuild

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

Open
#4,758 1 comment 0 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

### 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.