Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 29, 2025

This PR adds comprehensive documentation for three .NET SDK item templates that were missing from the official documentation:

buildprops template

  • Creates a Directory.Build.props file for customizing MSBuild properties across an entire folder tree
  • Documents the --inherit option for importing parent Directory.Build.props files
  • Documents the --use-artifacts option for enabling artifacts output layout with reference to artifacts documentation
  • Added in .NET SDK 8.0.100

buildtargets template

  • Creates a Directory.Build.targets file for customizing MSBuild targets and tasks across an entire folder tree
  • Documents the --inherit option for importing parent Directory.Build.targets files
  • Added in .NET SDK 8.0.100

sln template

  • Creates an empty solution file containing no projects
  • Documents the --format option available in .NET SDK 9.0.200+ for choosing between sln and slnx formats
  • Notes that .NET 10 will default to slnx format

Documentation Updates

  • Added the new templates to the templates table of contents in includes/templates.md with proper cross-references
  • Enhanced the --use-artifacts option description with a link to the artifacts output layout documentation
  • All sections follow existing documentation patterns with clear descriptions and detailed option explanations

All template options have been tested and verified for accuracy using the actual .NET SDK commands.

Fixes #48190.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.


Internal previews

📄 File 🔗 Preview link
docs/core/tools/dotnet-new-sdk-templates.md docs/core/tools/dotnet-new-sdk-templates

@Copilot Copilot AI changed the title [WIP] Add missing documentation for sln, buildprops, and buildtargets item templates Add missing documentation for sln, buildprops, and buildtargets item templates Aug 29, 2025
@Copilot Copilot AI requested a review from baronfel August 29, 2025 19:31
Copilot finished work on behalf of baronfel August 29, 2025 19:31
Copy link
Member

@baronfel baronfel left a comment

Choose a reason for hiding this comment

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

@copilot the new templates need to be added to or linked from the existing includes/templates.md table of contents

Copy link
Contributor Author

Copilot AI commented Aug 29, 2025

@copilot the new templates need to be added to or linked from the existing includes/templates.md table of contents

Added the buildprops and buildtargets templates to the templates.md table of contents with proper links to their documentation sections. The sln template was already listed but now has the correct link. Changes committed in 4891e45.

Copilot finished work on behalf of baronfel August 29, 2025 19:39
@Copilot Copilot AI requested a review from baronfel August 29, 2025 19:39
@baronfel baronfel marked this pull request as ready for review August 29, 2025 19:45
@baronfel baronfel requested review from adegeo and a team as code owners August 29, 2025 19:45
@@ -3,7 +3,7 @@ title: .NET default templates for dotnet new
description: The information about dotnet new templates shipped with dotnet SDK.
ms.custom: updateeachrelease
no-loc: [Blazor, WebAssembly]
ms.date: 02/21/2024
ms.date: 08/29/2024
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
ms.date: 08/29/2024
ms.date: 08/29/2025

Creates an empty solution file containing no projects.

> [!NOTE]
> In .NET SDK 9.0.200 and later, this template supports a `--format` option to choose between `sln` and `slnx` formats. Starting with .NET 10, the default format will be `slnx`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
> In .NET SDK 9.0.200 and later, this template supports a `--format` option to choose between `sln` and `slnx` formats. Starting with .NET 10, the default format will be `slnx`.
> In .NET SDK 9.0.200 and later, this template supports a `--format` option to choose between `sln` and `slnx` formats. Starting with .NET 10, the default format is `slnx`.

@@ -3,7 +3,7 @@ title: .NET default templates for dotnet new
description: The information about dotnet new templates shipped with dotnet SDK.
ms.custom: updateeachrelease
no-loc: [Blazor, WebAssembly]
ms.date: 02/21/2024
ms.date: 08/29/2024
---
# .NET default templates for dotnet new
Copy link
Contributor

Choose a reason for hiding this comment

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

I know it's unrelated to the changes, but seems like the title could just be:

Suggested change
# .NET default templates for dotnet new
# Default templates for `dotnet new`

Copy link
Contributor

Choose a reason for hiding this comment

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

And then the TOC entry at

- name: .NET default templates
should also be updated to just "Default templates".

Copy link
Contributor

Choose a reason for hiding this comment

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

Should the templates in the table be listed alphabetically to make it easier to find what you're looking for?

@@ -21,6 +21,30 @@ Each template may have additional options available. To show the additional opti
In case the template supports multiple languages, this command will show help for the template in the default language. By combining it with the `--language` option, you can see the help for other languages: `dotnet new console --help --language F#`.
The templates that ship with the .NET SDK have the following additional options:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The templates that ship with the .NET SDK have the following additional options:
The templates that ship with the .NET SDK have additional options that are described in the following sections.

@@ -21,6 +21,30 @@ Each template may have additional options available. To show the additional opti
In case the template supports multiple languages, this command will show help for the template in the default language. By combining it with the `--language` option, you can see the help for other languages: `dotnet new console --help --language F#`.
The templates that ship with the .NET SDK have the following additional options:

## `buildprops`
Copy link
Contributor

Choose a reason for hiding this comment

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

Since all of these sections are really about the options for each template, I feel like each template heading should be an H3, not an H2, to make them subheadings of ## Template options.

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.

Add missing documentation for sln, buildprops, and buildtargets item templates
3 participants