'How can we exclude certain folders from solution (and build) except one in .NET5?
Consider the following file structure:
- /Themes
- /Default
- /Theme-1
- /Theme-2
- /Theme-3
Is it possible to exclude all folders except the 'Default' folder?
MSDocs seem to suggest this is, or was, possible.
<Compile Include="*.res" Exclude="Form1.cs">
However, when I apply the following structure per the documentation, visual studio throws the following errors:
xxx.csproj : error : At most one of the include, remove, and update attributes may be specified for an item element.
When I simply add one exclude for all files followed by a separate include for the file I want to retain, it simply hides all files. Does anyone have any idea how to exclude all folders except certain ones?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
