Skip to content

Consider setting EnableDefaultEmbeddedResourceItems to false by default for file-based apps #51506

@jjonescz

Description

@jjonescz

To help mitigate issues like

I think people don't expect a simple file-based app to include ./**/*.resx files. When their file-based app becomes more complex, it would be more acceptable to start including default items. For example, if one adds #:sdk Microsoft.NET.Sdk.Web it will include ./**/*.json files and that seems fine.

This might be considered a breaking change. Although not a very big one, since for simple file-based apps, if the CSC-only optimization kicks in, default items like ./**/*.resx are not considered anyway (see #50912).

dotnet project convert would not need to include this property in the generated project, it's enough if it doesn't copy the .resx files to the output directory (which should simply just work thanks to the logic to find default items via msbuild during the conversion).

This change could also help with perf: #50912 - when we fix that issue, we wouldn't need to glob for ./**/*.resx on every run just to check that inputs are up to date.

Open questions

  • Should EnableDefaultEmbeddedResourceItems become true when the file-based app becomes more "complex", e.g., includes an #:sdk directive? Or should it remain false by default for all file-based apps, and people would need to opt-in via #:property EnableDefaultEmbeddedResourceItems=true?
  • Should there be a feature gate (like LangVersion, TFM) for changes like this?
  • Should we have EnableDefaultNoneItems=false, too? These seem to be useful only for being displayed in Solution Explorer (which isn't applicable to file-based apps anyway) or copy to output directory (but that needs some customization of build anyway so if ./**/* is not included by default, one would just use <None Include/> instead of <None Update/>).

@dotnet/run-file @rainersigwald for thoughts

Metadata

Metadata

Labels

Area-run-fileItems related to the "dotnet run <file>" effort

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions