Skip to content

Add guidance for Directory.Build.props and Directory.Build.targets to agents.md file #4979

@jamescrosswell

Description

@jamescrosswell

question: Directory.Build.props and Directory.Build.targets in sub-directories?

I noticed quite often that AI coding tools don't get MSBuild's hierarchical structure correctly:

  1. first Directory.Build.props/.targets found upwards from the project's location
  2. more parent Directory.Build.props/.targets files only if imported explicitly

So I'm wondering, if we should mention the other files, too ... something like:

- `samples/Directory.Build.props` / `samples/Directory.Build.targets` - shared MSBuild properties across all projects in the `samples` directory
- `src/Directory.Build.props` / `src/Directory.Build.targets` - shared MSBuild properties across all projects in the `src` directory
- `test/Directory.Build.props` / `test/Directory.Build.targets` - shared MSBuild properties across all projects in the `test` directory

Originally posted by @Flash0ver in #4974 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions