<EnableDefaultItems>true</EnableDefaultItems> not configurable
See original GitHub issueExample usage:
<PropertyGroup>
<EnableDefaultItems>true</EnableDefaultItems>
<DefaultItems>
<DefaultItem Type="Compile" Include="**/*.cs" Exclude="**/*.user; **/*.*proj; **/*.sln; **/*.vssscc" />
<DefaultItem Type="EmbeddedResource" Include="**/*.resx; **/*.sql" Exclude="**/*.user; **/*.*proj; **/*.sln; **/*.vssscc" />
<DefaultItem Type="None" Include="**/*" Exclude="**/*.user; **/*.*proj; **/*.sln; **/*.vssscc" />
</DefaultItems>
</PropertyGroup>
https://aka.ms/sdkimplicititems lays out the current behavior of EnableDefaultItems
- I find it strange that the only way to auto-include resources if they have a resx extension.
I love the ability to do the following, but it does not allow me to recursively include an entire folder as a certain Build Action (like EmbeddedResource):
<PropertyGroup>
<EnableDefaultItems>false</EnableDefaultItems>
</PropertyGroup>
I don’t know about most developers, but I hate project file merge conflicts, and we have to deal with a lot of them in our SQL projects using FluentMigrator. Our directory structure looks like:
Database.csproj
\_ Schema
\_ Functions
\_ Security
\_ Stored Procedures
\_ Triggers
\_ Types
\_ Views
Ideally, I want the ability to say “any item in this folder tree is an EmbeddedResource”. I realize you can use wildcards like <EmbeddedResource Include="Schema/**/*.sql" />
but the user story doesn’t work well - adding new SQL files includes them as Content, etc. Here is a link to a StackOverflow question where someone else opines on the same pain in a different context of RazorTemplate engine: https://stackoverflow.com/questions/27839645/automatically-add-files-as-embedded
Issue Analytics
- State:
- Created 5 years ago
- Comments:19 (11 by maintainers)
I see. I think we see once again that the
None
glob was probably a bad choice.However, in that case it sounds like the workaround could be to set the
EnableDefaultNoneItems
property to false.The Content glob in the Web SDK isn’t quite as bad, it only globs for all files under the wwwroot folder, and then for .json and .config files from the project root.
Yeah, I haven’t been able to come up with anything either.
I like @dsplaisted’s recommendations (this will not be surprising to folks that have worked with me on this: I don’t like the default globs in general).