question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

<EnableDefaultItems>true</EnableDefaultItems> not configurable

See original GitHub issue

Example 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:closed
  • Created 5 years ago
  • Comments:19 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
dsplaistedcommented, Mar 20, 2019

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.

2reactions
rainersigwaldcommented, Mar 20, 2019

@rainersigwald is there any way to go get metadata from one item into the globbing of other items? I suspect there isn’t.

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

PE T330 servers - Memory is detected, but is not ...
when the computer is restarted(automated), it stalls out at the POST with error message "Memory is detected, but is not configurable.
Read more >
Solved: PE T330 servers - Memory is detected, but is not ...
Solved: Installed three PwereEdge T330 servers for three different clients in the past few months. They have 16GB, 24GB and 32GB memory,
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found