dotnet / msbuild

The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
https://docs.microsoft.com/visualstudio/msbuild/msbuild
MIT License
5.2k stars 1.35k forks source link

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

Open rs-blade opened 4 years ago

rs-blade commented 4 years ago

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:

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.

livarcocc commented 4 years ago

Is your issue that the cs files from the subfolder are being picked up when building Foo.csproj? Or that the other projects are being build as well?