Skip to content

Document EmitCompilerGeneratedFiles and CompilerGeneratedFilesOutputPath MSBuild properties#52703

Open
Copilot wants to merge 3 commits intomainfrom
copilot/add-generate-documentation-file-doc
Open

Document EmitCompilerGeneratedFiles and CompilerGeneratedFilesOutputPath MSBuild properties#52703
Copilot wants to merge 3 commits intomainfrom
copilot/add-generate-documentation-file-doc

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 27, 2026

The MSBuild properties reference page was missing documentation for the source generator file output properties mentioned in the linked issue. (GenerateDocumentationFile was already documented.)

Changes

  • EmitCompilerGeneratedFiles — new section in "Generated file properties": controls whether Roslyn source generator output is written to disk during build (default: in-memory only)
  • CompilerGeneratedFilesOutputPath — new section: specifies the output directory for emitted files; defaults to obj/<config>/<tfm>/generated; includes a note on excluding the path from <Compile> to prevent double-compilation
  • Updated the section's property list to include both new entries (alphabetical order)
  • Updated ms.date and added ai-usage: ai-assisted to frontmatter

Usage example

<PropertyGroup>
  <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
  <CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath>
</PropertyGroup>

<!-- Prevent double-compilation if path is inside the source tree -->
<ItemGroup>
  <Compile Remove="$(CompilerGeneratedFilesOutputPath)/**/*.cs" />
</ItemGroup>

💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.


Internal previews

📄 File 🔗 Preview link
docs/core/project-sdk/msbuild-props.md MSBuild reference for .NET SDK projects

…ath MSBuild properties

Agent-Logs-Url: https://github.com/dotnet/docs/sessions/69835f40-43c4-4d11-88b1-ef533f47e226

Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
Copilot AI changed the title [WIP] Document GenerateDocumentationFile property Document EmitCompilerGeneratedFiles and CompilerGeneratedFilesOutputPath MSBuild properties Mar 27, 2026
Copilot AI requested a review from BillWagner March 27, 2026 14:22
Copy link
Copy Markdown
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM and is ready for final review.

@BillWagner BillWagner marked this pull request as ready for review March 27, 2026 15:52
@BillWagner BillWagner requested a review from gewarren as a code owner March 27, 2026 15:52
Copilot AI review requested due to automatic review settings March 27, 2026 15:52
@BillWagner BillWagner requested a review from a team as a code owner March 27, 2026 15:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the .NET SDK MSBuild properties reference to document two Roslyn source generator file output properties that weren’t previously covered.

Changes:

  • Adds documentation sections for EmitCompilerGeneratedFiles and CompilerGeneratedFilesOutputPath.
  • Updates the “Generated file properties” list to include the new entries.
  • Updates frontmatter (ms.date) and adds ai-usage: ai-assisted.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please document GenerateDocumentationFile property

3 participants