diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 000000000000..21f337bb132b --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "microsoft.dotnet.darc": { + "version": "1.1.0-beta.24367.3", + "commands": [ + "darc" + ] + } + } +} diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000000..e863320b378a --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,26 @@ +// For format details, see https://aka.ms/devcontainer.json. +{ + "name": "dotnet", + "image": "mcr.microsoft.com/devcontainers/base:debian", + "customizations": { + "vscode": { + "extensions": [ + "ms-dotnettools.csdevkit", + "EditorConfig.EditorConfig", + "DavidAnson.vscode-markdownlint" + ] + } + }, + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "bash -i ${containerWorkspaceFolder}/.devcontainer/scripts/post-creation.sh", + // Add the locally installed dotnet to the path to ensure that it is activated + // This is needed so that things like the C# extension can resolve the correct SDK version + "remoteEnv": { + "PATH": "${containerWorkspaceFolder}/.dotnet:${containerEnv:PATH}", + "DOTNET_INSTALL_DIR": "${containerWorkspaceFolder}/.dotnet", + "DOTNET_MULTILEVEL_LOOKUP": "0", + "DOTNET_ROOT": "${containerWorkspaceFolder}/.dotnet", + "DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR": "${containerWorkspaceFolder}/.dotnet", + "NUGET_PACKAGES": "/home/vscode/.nuget/packages" + } +} diff --git a/.devcontainer/scripts/post-creation.sh b/.devcontainer/scripts/post-creation.sh new file mode 100644 index 000000000000..217bf2390a0a --- /dev/null +++ b/.devcontainer/scripts/post-creation.sh @@ -0,0 +1,4 @@ +# Install SDK and tool dependencies before container starts +# Also run the full restore on the repo so that go-to definition +# and other language features will be available in C# files +./restore.sh diff --git a/.devcontainer/vmr/README.md b/.devcontainer/vmr/README.md new file mode 100644 index 000000000000..92bc3d8c5593 --- /dev/null +++ b/.devcontainer/vmr/README.md @@ -0,0 +1,61 @@ + + +This Codespace allows you to debug or make changes to the .NET SDK product. In case you ran this +from a `dotnet/sdk` PR branch, the directory tree contains the VMR (`dotnet/dotnet`) checked out into +`/workspaces/dotnet` with the PR changes pulled into it. Building the VMR from the codespace mimics +what the VMR pipelines in an sdk PR are doing. The build takes about 45-75 minutes +(depending on the machine spec and target OS) and, after completion, produces an archived .NET SDK located in +`/workspaces/dotnet/artifacts/assets/Release`. + +## Build the SDK + +To build the repository, run one of the following: +```bash +# Microsoft based build +./build.sh +``` +or + +```bash +# Building from source only +./prep-source-build.sh && ./build.sh -sb +``` + +> Please note that, at this time, the build modifies some of the checked-in sources so it might +be preferential to rebuild the Codespace between attempts (or reset the working tree changes). + +For more details, see the instructions at https://github.com/dotnet/dotnet. + +## Synchronize your changes in locally + +When debugging the build, you have two options how to test your changes in this environment. + +### Making changes to the VMR directly + +You can make the changes directly to the local checkout of the VMR at `/workspaces/dotnet`. You +can then try to build the VMR and see if the change works for you. + +### Pull changes into the Codespace from your fork + +You can also make a fix in the individual source repository (e.g. `dotnet/runtime`) and push the +fix into a branch; can be in your fork too. Once you have the commit pushed, you can pull this +version of the repository into the Codespace by running: + +``` +/workspaces/synchronize-vmr.sh \ + --repository : \ + --remote : +``` + +You can now proceed building the VMR in the Codespace using instructions above. You can repeat +this process and sync a new commit from your fork. Only note that, at this time, Source-Build +modifies some of the checked-in sources so you'll need to revert the working tree changes +between attempts. diff --git a/.devcontainer/vmr/devcontainer.json b/.devcontainer/vmr/devcontainer.json new file mode 100644 index 000000000000..950e3aaa7afe --- /dev/null +++ b/.devcontainer/vmr/devcontainer.json @@ -0,0 +1,25 @@ +// Container suitable for investigating issues with source build +// Contains the VMR (dotnet/dotnet) with applied changes from the current PR +// The container supports source-building the SDK +{ + "name": "VMR with PR changes", + "image": "mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-39", + "hostRequirements": { + // A completely source built .NET is >64 GB with all the repos/artifacts + "storage": "128gb" + }, + "customizations": { + "vscode": { + "extensions": [ + "ms-dotnettools.csharp" + ] + }, + "codespaces": { + "openFiles": [ + "sdk/.devcontainer/vmr/README.md" + ] + } + }, + "onCreateCommand": "${containerWorkspaceFolder}/sdk/.devcontainer/vmr/init.sh", + "workspaceFolder": "/workspaces" +} diff --git a/.devcontainer/vmr/init.sh b/.devcontainer/vmr/init.sh new file mode 100755 index 000000000000..bab633b97ada --- /dev/null +++ b/.devcontainer/vmr/init.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +set -ex + +source="${BASH_SOURCE[0]}" +script_root="$( cd -P "$( dirname "$source" )" && pwd )" + +sdk_dir=$(realpath "$script_root/../..") +workspace_dir=$(realpath "$sdk_dir/../") +tmp_dir=$(realpath "$workspace_dir/tmp") +vmr_dir=$(realpath "$workspace_dir/dotnet") + +cp "$sdk_dir/.devcontainer/vmr/synchronize-vmr.sh" "$workspace_dir" + +mkdir -p "$tmp_dir" + +# Codespaces performs a shallow fetch only +git -C "$sdk_dir" fetch --all --unshallow + +# We will try to figure out, which branch is the current (PR) branch based off of +# We need this to figure out, which VMR branch to use +vmr_branch=$(git -C "$sdk_dir" log --pretty=format:'%D' HEAD^ \ + | grep 'origin/' \ + | head -n1 \ + | sed 's@origin/@@' \ + | sed 's@,.*@@') + +"$workspace_dir/synchronize-vmr.sh" --branch "$vmr_branch" --debug + +(cd "$vmr_dir" && ./prep-source-build.sh) diff --git a/.devcontainer/vmr/synchronize-vmr.sh b/.devcontainer/vmr/synchronize-vmr.sh new file mode 100755 index 000000000000..5e9a9c307ff6 --- /dev/null +++ b/.devcontainer/vmr/synchronize-vmr.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +(cd /workspaces/sdk \ + && ./eng/vmr-sync.sh --vmr /workspaces/dotnet --tmp /workspaces/tmp $*) diff --git a/.editorconfig b/.editorconfig index dce656d22137..7c501a2c2680 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,6 +11,7 @@ insert_final_newline = true indent_style = space indent_size = 4 trim_trailing_whitespace = true +spelling_exclusion_path = ./exclusion.dic [*.json] indent_size = 2 @@ -273,11 +274,13 @@ dotnet_diagnostic.IDE0043.severity = warning dotnet_diagnostic.IDE0062.severity = warning # ConvertTypeOfToNameOf dotnet_diagnostic.IDE0082.severity = warning +# Remove unnecessary lambda expression +dotnet_diagnostic.IDE0200.severity = none # Remove redundant nullable directive dotnet_diagnostic.IDE0240.severity = warning # Additional rules for template engine source code -[src/**{Microsoft.TemplateEngine.*,dotnet-new?*}/**.cs] +[{src,test}/**{Microsoft.TemplateEngine.*,dotnet-new?*}/**.cs] # Default analyzed API surface = 'public' (public APIs) dotnet_code_quality.api_surface = public # Provide ObsoleteAttribute message @@ -313,7 +316,7 @@ dotnet_diagnostic.CA1838.severity = warning # Use 'Environment.CurrentManagedThreadId' dotnet_diagnostic.CA1840.severity = warning # Consider calling ConfigureAwait on the awaited task -dotnet_diagnostic.CA2007.severity = warning +dotnet_diagnostic.CA2007.severity = none # Do not create tasks without passing a TaskScheduler dotnet_diagnostic.CA2008.severity = warning # Use ValueTasks correctly @@ -442,7 +445,7 @@ dotnet_diagnostic.SA1642.severity = none dotnet_diagnostic.SA1649.severity = none # Disable some StyleCop rules for test common Program.cs that is linked to test project of template engine -[src/Tests/Common/Program.cs] +[test/Common/Program.cs] # Declare types in namespaces dotnet_diagnostic.CA1050.severity = none # Elements should be documented @@ -453,7 +456,7 @@ dotnet_diagnostic.SA1601.severity = none dotnet_diagnostic.SA1633.severity = none # Additional rules for test source code for template engine -[src/Tests/{Microsoft.TemplateEngine.*,dotnet-new.Tests}/**.cs] +[test/{Microsoft.TemplateEngine.*,dotnet-new.Tests}/**.cs] # Test methods should not be skipped dotnet_diagnostic.xUnit1004.severity = warning # Elements should appear in the correct order @@ -503,5 +506,12 @@ dotnet_diagnostic.IDE0040.severity = warning [*.txt] insert_final_newline = false -[src/Tests/dotnet-new.Tests/**/Approvals/**] -trim_trailing_whitespace = false +# Verify settings +[*.{received,verified}.{txt,xml,json}] +charset = "utf-8-bom" +end_of_line = lf +indent_size = unset +indent_style = unset +insert_final_newline = false +tab_width = unset +trim_trailing_whitespace = false \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index 1f7b7218ecd0..395c74ff4cd5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -55,4 +55,9 @@ *.jpg binary *.png binary -*.gif binary \ No newline at end of file +*.gif binary + +# VerifyTests +*.verified.txt text eol=lf working-tree-encoding=UTF-8 +*.verified.xml text eol=lf working-tree-encoding=UTF-8 +*.verified.json text eol=lf working-tree-encoding=UTF-8 diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 11f02b122f11..632858164761 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -7,12 +7,9 @@ contact_links: - name: Issue with .NET runtime or core .NET libraries url: https://github.com/dotnet/runtime/issues/new/choose about: Please open issues relating to the .NET runtime or core .NET libraries in dotnet/runtime. - - name: Issue with .NET SDK - url: https://github.com/dotnet/sdk/issues/new/choose - about: Please open issues relating to the .NET SDK itself in dotnet/sdk. - name: Issue with Entity Framework Core url: https://github.com/dotnet/efcore/issues/new/choose about: Please open issues relating to Entity Framework Core in dotnet/efcore. - name: Issue with Roslyn compiler url: https://github.com/dotnet/roslyn/issues/new/choose - about: Please open issues relating to the Roslyn .NET compiler in dotnet/roslyn. \ No newline at end of file + about: Please open issues relating to the Roslyn .NET compiler in dotnet/roslyn. diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 957b316a7a18..0fae5021e482 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,12 +10,12 @@ updates: - "dependencies" - "dependabot: main" - - package-ecosystem: "nuget" - directory: "/eng/dependabot" - open-pull-requests-limit: 10 - schedule: - interval: "weekly" - target-branch: "release/7.0.4xx" - labels: - - "dependencies" - - "dependabot: 7.0.4xx" + # - package-ecosystem: "nuget" + # directory: "/eng/dependabot" + # open-pull-requests-limit: 10 + # schedule: + # interval: "weekly" + # target-branch: "release/8.0.1xx" + # labels: + # - "dependencies" + # - "dependabot: 8.0.1xx" diff --git a/.github/fabricbot.json b/.github/fabricbot.json deleted file mode 100644 index 5850444abcec..000000000000 --- a/.github/fabricbot.json +++ /dev/null @@ -1,295 +0,0 @@ -{ - "version": "1.0", - "tasks": [ - { - "taskType": "trigger", - "capabilityId": "AutoMerge", - "subCapability": "AutoMerge", - "version": "1.0", - "config": { - "taskName": "Automatically merge pull requests", - "deleteBranches": true, - "removeLabelOnPush": true, - "mergeType": "squash", - "minMinutesOpen": "12", - "label": "Auto-Merge If Tests Pass", - "requireAllStatuses": true - } - }, - { - "taskType": "scheduled", - "capabilityId": "ScheduledSearch", - "subCapability": "ScheduledSearch", - "version": "1.1", - "config": { - "frequency": [ - { - "weekDay": 0, - "hours": [ - 16 - ], - "timezoneOffset": -7 - }, - { - "weekDay": 1, - "hours": [ - 16 - ], - "timezoneOffset": -7 - }, - { - "weekDay": 2, - "hours": [ - 16 - ], - "timezoneOffset": -7 - }, - { - "weekDay": 3, - "hours": [ - 16 - ], - "timezoneOffset": -7 - }, - { - "weekDay": 4, - "hours": [ - 16 - ], - "timezoneOffset": -7 - }, - { - "weekDay": 5, - "hours": [ - 16 - ], - "timezoneOffset": -7 - }, - { - "weekDay": 6, - "hours": [ - 16 - ], - "timezoneOffset": -7 - } - ], - "searchTerms": [ - { - "name": "isIssue", - "parameters": {} - }, - { - "name": "isOpen", - "parameters": {} - }, - { - "name": "hasLabel", - "parameters": { - "label": "Area-NuGet" - } - } - ], - "taskName": "Auto close \"Area-NuGet\" issues and add a comment pointing to NuGet repo", - "actions": [ - { - "name": "addReply", - "parameters": { - "comment": "Thanks for creating this issue! We believe this issue is related to NuGet tooling, which is maintained by the NuGet team. Thus, we closed this one and encourage you to raise this issue in the [NuGet repository](https://github.com/NuGet/Home) instead. Don’t forget to check out [NuGet’s contributing guide](https://github.com/NuGet/Home/blob/dev/CONTRIBUTING.md#before-submitting-an-issue) before submitting an issue!\n\nIf you believe this issue was closed out of error, please comment to let us know.\n\nHappy Coding!" - } - }, - { - "name": "closeIssue", - "parameters": {} - } - ] - }, - "disabled": false - }, - { - "taskType": "trigger", - "capabilityId": "IssueResponder", - "subCapability": "IssuesOnlyResponder", - "version": "1.0", - "config": { - "conditions": { - "operator": "and", - "operands": [ - { - "name": "labelAdded", - "parameters": { - "label": "Area-ApiCompat" - } - } - ] - }, - "eventType": "issue", - "eventNames": [ - "issues", - "project_card" - ], - "taskName": "Notify apicompat of new untriaged bugs", - "actions": [ - { - "name": "addReply", - "parameters": { - "comment": "@dotnet/area-infrastructure-libraries a new issue has been filed in the ApiCompat area, please triage" - } - } - ] - } - }, - { - "taskType": "trigger", - "capabilityId": "IssueResponder", - "subCapability": "IssuesOnlyResponder", - "version": "1.0", - "config": { - "conditions": { - "operator": "and", - "operands": [ - { - "name": "labelAdded", - "parameters": { - "label": "Area-ILLink" - } - } - ] - }, - "eventType": "issue", - "eventNames": [ - "issues", - "project_card" - ], - "taskName": "Notify linker of new untriaged bugs", - "actions": [ - { - "name": "addReply", - "parameters": { - "comment": "@dotnet/illink-contrib a new issue has been filed in the ILLink area, please triage" - } - } - ] - } - }, - { - "taskType": "trigger", - "capabilityId": "IssueResponder", - "subCapability": "PullRequestResponder", - "version": "1.0", - "config": { - "conditions": { - "operator": "and", - "operands": [ - { - "name": "labelAdded", - "parameters": { - "label": "Area-AspNetCore" - } - }, - { - "name": "isOpen", - "parameters": {} - } - ] - }, - "eventType": "pull_request", - "eventNames": [ - "pull_request", - "issues", - "project_card" - ], - "taskName": "Remind ASP.NET Core PR authors the process to follow", - "actions": [ - { - "name": "addReply", - "parameters": { - "comment": "Thanks for your PR, @${issueAuthor}.\nTo learn about the PR process and branching schedule of this repo, please take a look at the [SDK PR Guide](https://github.com/dotnet/sdk/blob/main/documentation/project-docs/SDK-PR-guide.md)." - } - } - ] - } - }, - { - "taskType": "trigger", - "capabilityId": "IssueResponder", - "subCapability": "IssuesOnlyResponder", - "version": "1.0", - "config": { - "conditions": { - "operator": "and", - "operands": [ - { - "name": "labelAdded", - "parameters": { - "label": "breaking-change" - } - } - ] - }, - "eventType": "issue", - "eventNames": [ - "issues", - "project_card" - ], - "actions": [ - { - "name": "addLabel", - "parameters": { - "label": "needs-breaking-change-doc-created" - } - }, - { - "name": "addReply", - "parameters": { - "comment": "Added `needs-breaking-change-doc-created` label because this issue has the `breaking-change` label. \n\n1. [ ] Create and link to this issue a matching issue in the dotnet/docs repo using the [breaking change documentation template](https://aka.ms/dotnet/docs/new-breaking-change-issue), then remove this `needs-breaking-change-doc-created` label.\n\nTagging @dotnet/compat for awareness of the breaking change." - } - } - ], - "taskName": "Add breaking change doc label to issue" - }, - "disabled": false - }, - { - "taskType": "trigger", - "capabilityId": "IssueResponder", - "subCapability": "PullRequestResponder", - "version": "1.0", - "config": { - "conditions": { - "operator": "and", - "operands": [ - { - "name": "labelAdded", - "parameters": { - "label": "breaking-change" - } - } - ] - }, - "eventType": "pull_request", - "eventNames": [ - "pull_request", - "issues", - "project_card" - ], - "actions": [ - { - "name": "addLabel", - "parameters": { - "label": "needs-breaking-change-doc-created" - } - }, - { - "name": "addReply", - "parameters": { - "comment": "Added `needs-breaking-change-doc-created` label because this PR has the `breaking-change` label. \n\nWhen you commit this breaking change:\n\n1. [ ] Create and link to this PR and the issue a matching issue in the dotnet/docs repo using the [breaking change documentation template](https://aka.ms/dotnet/docs/new-breaking-change-issue), then remove this `needs-breaking-change-doc-created` label.\n2. [ ] Ask a committer to mail the `.NET Breaking Change Notification` DL.\n\nTagging @dotnet/compat for awareness of the breaking change." - } - } - ], - "taskName": "Add breaking change doc label to PR" - }, - "disabled": false - } - ], - "userGroups": [] -} diff --git a/.github/policies/resourceManagement.yml b/.github/policies/resourceManagement.yml new file mode 100644 index 000000000000..88fbb271fbcf --- /dev/null +++ b/.github/policies/resourceManagement.yml @@ -0,0 +1,115 @@ +id: +name: GitOps.PullRequestIssueManagement +description: GitOps.PullRequestIssueManagement primitive +owner: +resource: repository +disabled: false +where: +configuration: + resourceManagementConfiguration: + scheduledSearches: + - description: Auto close "Area-NuGet" issues and add a comment pointing to NuGet repo + frequencies: + - daily: + time: 16:0 + filters: + - isIssue + - isOpen + - hasLabel: + label: Area-NuGet + actions: + - addReply: + reply: >- + Thanks for creating this issue! We believe this issue is related to NuGet tooling, which is maintained by the NuGet team. Thus, we closed this one and encourage you to raise this issue in the [NuGet repository](https://github.com/NuGet/Home) instead. Don’t forget to check out [NuGet’s contributing guide](https://github.com/NuGet/Home/blob/dev/CONTRIBUTING.md#before-submitting-an-issue) before submitting an issue! + + + If you believe this issue was closed out of error, please comment to let us know. + + + Happy Coding! + - closeIssue + eventResponderTasks: + - if: + - payloadType: Pull_Request + - hasLabel: + label: Auto-Merge If Tests Pass + then: + - enableAutoMerge: + mergeMethod: Squash + description: Automatically merge pull requests + - if: + - payloadType: Pull_Request + - labelRemoved: + label: Auto-Merge If Tests Pass + then: + - disableAutoMerge + description: Automatically merge pull requests + - if: + - payloadType: Issues + - labelAdded: + label: Area-ApiCompat + then: + - addReply: + reply: '@dotnet/area-infrastructure-libraries a new issue has been filed in the ApiCompat area, please triage' + description: Notify apicompat of new untriaged bugs + - if: + - payloadType: Issues + - labelAdded: + label: Area-ILLink + then: + - addReply: + reply: '@dotnet/illink a new issue has been filed in the ILLink area, please triage' + description: Notify linker of new untriaged bugs + - if: + - payloadType: Pull_Request + - labelAdded: + label: Area-AspNetCore + - isOpen + then: + - addReply: + reply: >- + Thanks for your PR, @${issueAuthor}. + + To learn about the PR process and branching schedule of this repo, please take a look at the [SDK PR Guide](https://github.com/dotnet/sdk/blob/main/documentation/project-docs/SDK-PR-guide.md). + description: Remind ASP.NET Core PR authors the process to follow + - if: + - payloadType: Issues + - labelAdded: + label: breaking-change + then: + - addLabel: + label: needs-breaking-change-doc-created + - addReply: + reply: >- + Added `needs-breaking-change-doc-created` label because this issue has the `breaking-change` label. + + + 1. [ ] Create and link to this issue a matching issue in the dotnet/docs repo using the [breaking change documentation template](https://aka.ms/dotnet/docs/new-breaking-change-issue), then remove this `needs-breaking-change-doc-created` label. + + + Tagging @dotnet/compat for awareness of the breaking change. + description: Add breaking change doc label to issue + - if: + - payloadType: Pull_Request + - labelAdded: + label: breaking-change + then: + - addLabel: + label: needs-breaking-change-doc-created + - addReply: + reply: >- + Added `needs-breaking-change-doc-created` label because this PR has the `breaking-change` label. + + + When you commit this breaking change: + + + 1. [ ] Create and link to this PR and the issue a matching issue in the dotnet/docs repo using the [breaking change documentation template](https://aka.ms/dotnet/docs/new-breaking-change-issue), then remove this `needs-breaking-change-doc-created` label. + + 2. [ ] Ask a committer to mail the `.NET Breaking Change Notification` DL. + + + Tagging @dotnet/compat for awareness of the breaking change. + description: Add breaking change doc label to PR +onFailure: +onSuccess: diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml new file mode 100644 index 000000000000..6bccec8ec7ad --- /dev/null +++ b/.github/workflows/backport.yml @@ -0,0 +1,19 @@ +name: Backport PR to branch +on: + issue_comment: + types: [created] + +permissions: + contents: write + issues: write + pull-requests: write + actions: write + +jobs: + backport: + uses: dotnet/arcade/.github/workflows/backport-base.yml@main + with: + pr_description_template: | + Backport of #%source_pr_number% to %target_branch% + + /cc %cc_users% \ No newline at end of file diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 000000000000..ca14360c2ea8 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,39 @@ +name: 'Stale: Label and Close Issues' +on: + schedule: + - cron: '19 4,16 * * *' # Twice daily at 19 minutes after the hour (random/uncommon time) + + workflow_dispatch: + # Manual triggering through the GitHub UI, API, or CLI + inputs: + daysBeforeStale: + required: true + default: "2192" + daysBeforeClose: + required: true + default: "30" + operationsPerRun: + required: true + default: "4000" + +permissions: + actions: write # For managing the operation state cache + issues: write + +jobs: + stale: + if: github.repository_owner == 'dotnet' # Do not run on forks + + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v9 # https://github.com/actions/stale/blob/v9/README.md + with: + ascending: true # Process the oldest issues first + stale-issue-label: 'stale' + stale-issue-message: "Due to lack of recent activity, this issue has been labeled as 'stale'. It will be closed if no further activity occurs within 30 more days. Any new comment will remove the label." + close-issue-message: "This issue will now be closed since it has been labeled 'stale' without activity for 30 days." + days-before-stale: ${{ fromJson(inputs.daysBeforeStale || 2192) }} # Default to 6 years if not specified as input + days-before-close: ${{ fromJson(inputs.daysBeforeClose || 30 ) }} # Default to 30 days if not specified as input + days-before-pr-stale: -1 # Do not label PRs as 'stale' + days-before-pr-close: -1 # Do not close PRs labeled as 'stale' + operations-per-run: ${{ fromJson(inputs.operationsPerRun || 4000 )}} diff --git a/.gitignore b/.gitignore index 2be928e40089..7a95c9dded4a 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,7 @@ cmake/ # MSBuild Logs **/MSBuild_Logs/MSBuild_pid-*.failure.txt + +# Test results +**/*.trx +/TestResults diff --git a/.vsts-ci-richnav.yml b/.vsts-ci-richnav.yml deleted file mode 100644 index bf8a032bf063..000000000000 --- a/.vsts-ci-richnav.yml +++ /dev/null @@ -1,87 +0,0 @@ -trigger: - batch: true - branches: - include: - - main - - release/*.* - -pr: none - -variables: - - name: teamName - value: Roslyn-Project-System - - name: PostBuildSign - value: true - - template: /eng/common/templates/variables/pool-providers.yml - -stages: -- stage: build - displayName: Build - jobs: - - template: /eng/common/templates/job/job.yml - parameters: - name: Windows_NT_FullFramework - enableRichCodeNavigation: true - richCodeNavigationLanguage: 'csharp' - richCodeNavigationEnvironment: 'production' - pool: - name: $(DncEngPublicBuildPool) - demands: ImageOverride -equals windows.vs2019.amd64.open - timeoutInMinutes: 180 - strategy: - matrix: - Build_Debug: - _BuildConfig: Debug - _PublishType: none - _SignType: test - _Test: -test - workspace: - clean: all - variables: - - _AgentOSName: Windows_NT_FullFramework - - _TeamName: DotNetCore - - _OfficialBuildIdArgs: '' - - _PublishArgs: '' - - _SignArgs: '' - - _InternalRuntimeDownloadArgs: '' - steps: - - template: /eng/common/templates/steps/enable-internal-runtimes.yml - - powershell: eng\common\build.ps1 - -restore - -ci - -build - -pack - -sign - -configuration $(_BuildConfig) - $(_PublishArgs) - $(_SignArgs) - $(_OfficialBuildIdArgs) - $(_InternalRuntimeDownloadArgs) - /p:Test=false - displayName: Build - env: - BuildConfig: $(_BuildConfig) - PublishType: $(_PublishType) - TestFullMSBuild: 'true' - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - - - task: CopyFiles@2 - displayName: Gather Logs - inputs: - SourceFolder: '$(Build.SourcesDirectory)/artifacts' - Contents: | - log/$(_BuildConfig)/**/* - TestResults/$(_BuildConfig)/**/* - SymStore/$(_BuildConfig)/**/* - TargetFolder: '$(Build.ArtifactStagingDirectory)' - continueOnError: true - condition: always() - - - task: PublishBuildArtifacts@1 - displayName: Publish Logs to VSTS - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)' - ArtifactName: '$(_AgentOSName)_$(Agent.JobName)_$(Build.BuildNumber)' - publishLocation: Container - continueOnError: true - condition: always() diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 1d77a6699c99..8959c26c3e0b 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -1,9 +1,11 @@ +# Pipeline: https://dev.azure.com/dnceng/internal/_build?definitionId=286 + trigger: batch: true branches: include: - main - - release/8.0.4xx + - release/9.0.1xx - internal/release/* - exp/* @@ -14,37 +16,38 @@ pr: - release/* - internal/release/* +parameters: +# When true, runs the pipeline in the same way as the PR pipeline. +- name: runTestBuild + displayName: Run A Test Build + type: boolean + default: false variables: - - name: _CIBuild - value: -restore -build -sign -pack -ci - - ${{ if or(startswith(variables['Build.SourceBranch'], 'refs/heads/release/'), startswith(variables['Build.SourceBranch'], 'refs/heads/internal/release/'), eq(variables['Build.Reason'], 'Manual')) }}: - - name: PostBuildSign - value: false - - ${{ else }}: - - name: PostBuildSign - value: true - - ${{ if eq(variables['System.TeamProject'], 'public') }}: - - name: _InternalRuntimeDownloadArgs - value: '' - - name: _OfficialBuildArgs - value: '' - - name: "skipComponentGovernanceDetection" - value: "true" - - ${{ if ne(variables['System.TeamProject'], 'public') }}: - - name: _OfficialBuildArgs - value: /p:OfficialBuilder=Microsoft - - name: Codeql.Enabled - value: true - - name: _InternalRuntimeDownloadArgs - value: /p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal - /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64) - - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - group: DotNet-CLI-SDLValidation-Params - - template: /eng/common/templates-official/variables/pool-providers.yml - # Set the MicroBuild plugin installation directory to the agent temp directory to avoid SDL tool scanning. - - name: MicroBuildOutputFolderOverride - value: $(Agent.TempDirectory) +- template: /eng/pipelines/templates/variables/sdk-defaults.yml +# Variables used: DncEngInternalBuildPool +- template: /eng/common/templates-official/variables/pool-providers.yml +# Helix testing requires a token when internally run. +# Variables used: HelixApiAccessToken +- group: DotNet-HelixApi-Access +- group: AzureDevOps-Artifact-Feeds-Pats +# Allows Arcade to run a signed build by disabling post-build signing for release-branch builds or manual builds that are not running tests. +- ${{ if and(eq(parameters.runTestBuild, false), or(startswith(variables['Build.SourceBranch'], 'refs/heads/release/'), startswith(variables['Build.SourceBranch'], 'refs/heads/internal/release/'), eq(variables['Build.Reason'], 'Manual'))) }}: + - name: PostBuildSign + value: false +# Provides TSA variables for automatic bug reporting. +- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: + - group: DotNet-CLI-SDLValidation-Params +### LOCAL ONLY ### +- name: _publishArgument + value: -publish +- name: _signArgument + value: -sign /p:SignCoreSdk=true +- name: _officialBuildProperties + # The OfficialBuilder property is set to Microsoft for the official build only. + # This property is checked in Directory.Build.props and adds the MICROSOFT_ENABLE_TELEMETRY constant. + # This constant is used in CompileOptions.cs to set both TelemetryOptOutDefault and TelemetryOptOutDefaultString. + value: /p:DotNetPublishUsingPipelines=true /p:OfficialBuilder=Microsoft /p:OfficialBuildId=$(Build.BuildNumber) resources: repositories: @@ -54,251 +57,275 @@ resources: ref: refs/tags/release extends: - template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines + ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: + template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines + ${{ else }}: + template: v1/1ES.Unofficial.PipelineTemplate.yml@1esPipelines parameters: + containers: + alpine319WithNode: + image: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.19-WithNode + cblMariner20Fpm: + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-fpm + centosStream9: + image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9 + debian12Amd64: + image: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-gcc14-amd64 + fedora39: + image: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-39 + mariner20CrossArm: + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm + ubuntu2204DebPkg: + image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-debpkg sdl: sourceAnalysisPool: name: $(DncEngInternalBuildPool) image: 1es-windows-2022 os: windows + ${{ if or(eq(parameters.runTestBuild, true), eq(variables['Build.Reason'], 'PullRequest')) }}: + componentgovernance: + # Refdoc: https://docs.opensource.microsoft.com/tools/cg/component-detection/variables/ + ignoreDirectories: artifacts, .packages + stages: + ############### BUILD STAGE ############### - stage: build displayName: Build jobs: - - job: Publish_Build_Configuration - pool: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - name: $(DncEngPublicBuildPool) - image: 1es-windows-2022-open - os: windows - ${{ if eq(variables['System.TeamProject'], 'internal') }}: + ############### WINDOWS ############### + - template: /eng/pipelines/templates/jobs/sdk-job-matrix.yml@self + parameters: + pool: name: $(DncEngInternalBuildPool) image: 1es-windows-2022 os: windows - steps: - - task: 1ES.PublishPipelineArtifact@1 - displayName: Publish Build Config - inputs: - targetPath: $(Build.SourcesDirectory)\eng\buildConfiguration - artifactName: buildConfiguration - - template: /eng/build.yml@self + helixTargetQueue: windows.amd64.vs2022.pre + oneESCompat: + templateFolderName: templates-official + publishTaskPrefix: 1ES. + runtimeSourceProperties: /p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64) + locBranch: release/9.0.2xx + ${{ if and(eq(parameters.runTestBuild, false), ne(variables['Build.Reason'], 'PullRequest')) }}: + timeoutInMinutes: 90 + windowsJobParameterSets: + ### OFFICIAL ### + - categoryName: Official + publishArgument: $(_publishArgument) + signArgument: $(_signArgument) + officialBuildProperties: $(_officialBuildProperties) + enableDefaultArtifacts: true + runTests: false + publishRetryConfig: true + variables: + _SignType: real + - categoryName: Official + buildArchitecture: x86 + publishArgument: $(_publishArgument) + signArgument: $(_signArgument) + officialBuildProperties: $(_officialBuildProperties) + runTests: false + variables: + _SignType: real + - categoryName: Official + buildArchitecture: arm64 + publishArgument: $(_publishArgument) + signArgument: $(_signArgument) + officialBuildProperties: $(_officialBuildProperties) + runTests: false + variables: + _SignType: real + ### PGO ### + - categoryName: PGO + pgoInstrument: true + publishArgument: $(_publishArgument) + signArgument: $(_signArgument) + officialBuildProperties: $(_officialBuildProperties) + runTests: false + variables: + _SignType: real + - categoryName: PGO + pgoInstrument: true + buildArchitecture: x86 + publishArgument: $(_publishArgument) + signArgument: $(_signArgument) + officialBuildProperties: $(_officialBuildProperties) + runTests: false + variables: + _SignType: real + - categoryName: PGO + pgoInstrument: true + buildArchitecture: arm64 + publishArgument: $(_publishArgument) + signArgument: $(_signArgument) + officialBuildProperties: $(_officialBuildProperties) + runTests: false + variables: + _SignType: real + + ############### LINUX ############### + - template: /eng/pipelines/templates/jobs/sdk-job-matrix.yml@self parameters: - agentOs: Windows_NT pool: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - name: $(DncEngPublicBuildPool) - image: 1es-windows-2022-open - os: windows - ${{ if ne(variables['System.TeamProject'], 'public') }}: - name: $(DncEngInternalBuildPool) - image: 1es-windows-2022 - os: windows - ${{ if eq(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: Windows.Amd64.VS2022.Pre.Open - ${{ if ne(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: Windows.Amd64.VS2022.Pre - variables: - - name: _BuildConfig - value: Release - - name: _PublishArgs - value: '-publish /p:DotNetPublishUsingPipelines=true' - - ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}: - - name: _SignType - value: test - - name: _Test - value: -test - - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - name: _SignType - value: real - - name: _Test - value: '' + name: $(DncEngInternalBuildPool) + image: 1es-ubuntu-2204 + os: linux + helixTargetQueue: ubuntu.2204.amd64 + oneESCompat: + templateFolderName: templates-official + publishTaskPrefix: 1ES. + runtimeSourceProperties: /p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64) + ${{ if and(eq(parameters.runTestBuild, false), ne(variables['Build.Reason'], 'PullRequest')) }}: + timeoutInMinutes: 90 + linuxJobParameterSets: + ### OFFICIAL ### + # Note: These builds are also portable like the Portable category, but that category uses containers, and doesn't publish zips and tarballs. + - categoryName: Official + publishArgument: $(_publishArgument) + officialBuildProperties: $(_officialBuildProperties) + osProperties: $(linuxOsPortableProperties) + runTests: false + - categoryName: Official + buildArchitecture: arm + runtimeIdentifier: linux-arm + publishArgument: $(_publishArgument) + officialBuildProperties: $(_officialBuildProperties) + osProperties: $(linuxOsPortableProperties) + runTests: false + - categoryName: Official + buildArchitecture: arm64 + runtimeIdentifier: linux-arm64 + publishArgument: $(_publishArgument) + officialBuildProperties: $(_officialBuildProperties) + osProperties: $(linuxOsPortableProperties) + runTests: false + ### PORTABLE ### + - categoryName: Portable + container: ubuntu2204DebPkg + # Do not publish zips and tarballs. The linux-x64 binaries are already published by Official. + publishArgument: $(_publishArgument) /p:PublishBinariesAndBadge=false + officialBuildProperties: $(_officialBuildProperties) + osProperties: $(linuxOsPortableProperties) /p:BuildSdkDeb=true + runTests: false + - categoryName: Portable + container: cblMariner20Fpm + # Do not publish zips and tarballs. The linux-x64 binaries are already published by Official. + publishArgument: $(_publishArgument) /p:PublishBinariesAndBadge=false + officialBuildProperties: $(_officialBuildProperties) + osProperties: $(linuxOsPortableProperties) /p:IsRPMBasedDistro=true + runTests: false + - categoryName: Portable + container: cblMariner20Fpm + buildArchitecture: arm64 + runtimeIdentifier: linux-arm64 + # Do not publish zips and tarballs. The linux-arm64 binaries are already published by Official. + publishArgument: $(_publishArgument) /p:PublishBinariesAndBadge=false /p:CLIBUILD_SKIP_TESTS=true + officialBuildProperties: $(_officialBuildProperties) + osProperties: $(linuxOsPortableProperties) /p:IsRPMBasedDistro=true + runTests: false + ### MUSL ### + - categoryName: Musl + container: alpine319WithNode + runtimeIdentifier: linux-musl-x64 + publishArgument: $(_publishArgument) + officialBuildProperties: $(_officialBuildProperties) + # Use HostOSName when running on alpine. + osProperties: /p:HostOSName=linux-musl + # SBOM generation is not supported for alpine. + enableSbom: false + runTests: false + - categoryName: Musl + container: mariner20CrossArm + buildArchitecture: arm + runtimeIdentifier: linux-musl-arm + publishArgument: $(_publishArgument) + officialBuildProperties: $(_officialBuildProperties) + osProperties: /p:OSName=linux-musl + runTests: false + - categoryName: Musl + buildArchitecture: arm64 + runtimeIdentifier: linux-musl-arm64 + publishArgument: $(_publishArgument) + officialBuildProperties: $(_officialBuildProperties) + osProperties: /p:OSName=linux-musl + runTests: false + ### PGO ### + - categoryName: PGO + pgoInstrument: true + publishArgument: $(_publishArgument) + officialBuildProperties: $(_officialBuildProperties) + osProperties: $(linuxOsPortableProperties) + runTests: false + - categoryName: PGO + pgoInstrument: true + buildArchitecture: arm64 + runtimeIdentifier: linux-arm64 + publishArgument: $(_publishArgument) + officialBuildProperties: $(_officialBuildProperties) + osProperties: $(linuxOsPortableProperties) + runTests: false + + ############### MACOS ############### + - template: /eng/pipelines/templates/jobs/sdk-job-matrix.yml@self + parameters: + pool: + name: Azure Pipelines + image: macOS-latest + os: macOS + helixTargetQueue: osx.13.amd64 + oneESCompat: + templateFolderName: templates-official + publishTaskPrefix: 1ES. + runtimeSourceProperties: /p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64) + ${{ if and(eq(parameters.runTestBuild, false), ne(variables['Build.Reason'], 'PullRequest')) }}: + timeoutInMinutes: 90 + macOSJobParameterSets: + ### OFFICIAL ### + - categoryName: Official + runtimeIdentifier: osx-x64 + publishArgument: $(_publishArgument) + officialBuildProperties: $(_officialBuildProperties) + runTests: false + - categoryName: Official + buildArchitecture: arm64 + runtimeIdentifier: osx-arm64 + publishArgument: $(_publishArgument) + officialBuildProperties: $(_officialBuildProperties) + runTests: false + + ############### SOURCE BUILD ############### - template: /eng/common/templates-official/job/source-build.yml@self parameters: enableInternalSources: true platform: - name: 'Managed' - container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9' - - ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}: - - template: /eng/build.yml@self - parameters: - agentOs: Windows_NT_FullFramework - pool: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - name: $(DncEngPublicBuildPool) - image: 1es-windows-2022-open - os: windows - ${{ if ne(variables['System.TeamProject'], 'public') }}: - name: $(DncEngInternalBuildPool) - image: 1es-windows-2022 - os: windows - ${{ if eq(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: Windows.Amd64.VS2022.Pre.Open - ${{ if ne(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: Windows.Amd64.VS2022.Pre - variables: - - name: _BuildConfig - value: Debug - - name: _PublishArgs - value: '' - - name: _SignType - value: test - - name: _Test - value: -test + name: Managed + container: centosStream9 + jobProperties: + timeoutInMinutes: 30 - - template: /eng/build.yml@self + ############### DOTNET-FORMAT ############### + - ${{ if or(eq(parameters.runTestBuild, true), eq(variables['Build.Reason'], 'PullRequest')) }}: + - template: /eng/dotnet-format/dotnet-format-integration.yml@self parameters: - agentOs: Windows_NT_TestAsTools - pool: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - name: $(DncEngPublicBuildPool) - image: 1es-windows-2022-open - os: windows - ${{ if ne(variables['System.TeamProject'], 'public') }}: - name: $(DncEngInternalBuildPool) - image: 1es-windows-2022 - os: windows - variables: - - name: _BuildConfig - value: Debug - - name: _PublishArgs - value: '' - - name: _SignType - value: test + oneESCompat: + publishTaskPrefix: 1ES. + runtimeSourceProperties: /p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64) - - template: /eng/build.yml@self - parameters: - agentOs: Ubuntu_22_04 - pool: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - name: $(DncEngPublicBuildPool) - image: 1es-ubuntu-2204-open - os: linux - ${{ if ne(variables['System.TeamProject'], 'public') }}: - name: $(DncEngInternalBuildPool) - image: 1es-ubuntu-2204 - os: linux - ${{ if eq(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: ubuntu.2204.amd64.open - ${{ if ne(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: Ubuntu.2204.Amd64 - variables: - - name: _BuildConfig - value: Release - - name: _PublishArgs - value: '' - - name: _SignType - value: test - - name: _Test - value: -test - - - template: /eng/build.yml@self - parameters: - agentOs: Darwin - pool: - name: Azure Pipelines - image: macOS-latest - os: macOS - ${{ if eq(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: OSX.13.Amd64.Open - ${{ if ne(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: OSX.13.Amd64 - variables: - - name: _BuildConfig - value: Release - - name: _PublishArgs - value: '' - - name: _SignType - value: test - - name: _Test - value: -test - - # template-engine builds - - template: /eng/build.yml@self - parameters: - agentOs: Windows_NT_TemplateEngine - pool: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - name: $(DncEngPublicBuildPool) - image: 1es-windows-2022-open - os: windows - ${{ if ne(variables['System.TeamProject'], 'public') }}: - name: $(DncEngInternalBuildPool) - image: 1es-windows-2022 - os: windows - ${{ if eq(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: Windows.Amd64.VS2022.Pre.Open - ${{ if ne(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: Windows.Amd64.VS2022.Pre - variables: - - name: _BuildConfig - value: Release - - name: PublishArgs - value: '-publish /p:DotNetPublishUsingPipelines=true' - - name: _SignType - value: test - - name: _Test - value: -test - - - template: /eng/build.yml@self - parameters: - agentOs: Ubuntu_22_04_TemplateEngine - pool: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - name: $(DncEngPublicBuildPool) - image: 1es-ubuntu-2204-open - os: linux - ${{ if ne(variables['System.TeamProject'], 'public') }}: - name: $(DncEngInternalBuildPool) - image: 1es-ubuntu-2204 - os: linux - ${{ if eq(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: 'ubuntu.2204.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-helix-amd64' - ${{ if ne(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: Ubuntu.2204.Amd64 - variables: - - name: _BuildConfig - value: Release - - name: _PublishArgs - value: '' - - name: _SignType - value: test - - name: _Test - value: -test - - - template: /eng/build.yml@self - parameters: - agentOs: Darwin_TemplateEngine - pool: - name: Azure Pipelines - image: macOS-latest - os: macOS - ${{ if eq(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: OSX.1100.Amd64.Open - ${{ if ne(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: OSX.1100.Amd64 - variables: - - name: _BuildConfig - value: Release - - name: _PublishArgs - value: '' - - name: _SignType - value: test - - name: _Test - value: -test - - - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + ############### PUBLISH STAGE ############### + - ${{ if and(eq(parameters.runTestBuild, false), ne(variables['Build.Reason'], 'PullRequest')) }}: + - stage: publish + displayName: Publish + dependsOn: build + jobs: - template: /eng/common/templates-official/job/publish-build-assets.yml@self parameters: publishUsingPipelines: true publishAssetsImmediately: true - dependsOn: - - Windows_NT - - Source_Build_Managed pool: name: $(DncEngInternalBuildPool) image: 1es-windows-2022 os: windows - - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + + ############### POST-BUILD STAGE ############### - template: /eng/common/templates-official/post-build/post-build.yml@self parameters: publishingInfraVersion: 3 diff --git a/.vsts-pr.yml b/.vsts-pr.yml index 668b3b1e47b9..584f725feb86 100644 --- a/.vsts-pr.yml +++ b/.vsts-pr.yml @@ -1,11 +1,6 @@ -trigger: - batch: true - branches: - include: - - main - - release/8.0.4xx - - internal/release/* - - exp/* +# Pipeline: https://dev.azure.com/dnceng-public/public/_build?definitionId=101 + +trigger: none pr: branches: @@ -14,192 +9,65 @@ pr: - release/* - internal/release/* - variables: - - name: teamName - value: Roslyn-Project-System - - name: _CIBuild - value: -restore -build -sign -pack -ci - - ${{ if or(startswith(variables['Build.SourceBranch'], 'refs/heads/release/'), startswith(variables['Build.SourceBranch'], 'refs/heads/internal/release/'), eq(variables['Build.Reason'], 'Manual')) }}: - - name: PostBuildSign - value: false - - ${{ else }}: - - name: PostBuildSign - value: true - - ${{ if eq(variables['System.TeamProject'], 'public') }}: - - name: _InternalRuntimeDownloadArgs - value: '' - - name: _OfficialBuildArgs - value: '' - - name: "skipComponentGovernanceDetection" - value: "true" - - ${{ if ne(variables['System.TeamProject'], 'public') }}: - - name: _OfficialBuildArgs - value: /p:OfficialBuilder=Microsoft - - name: Codeql.Enabled - value: true - - name: _InternalRuntimeDownloadArgs - value: /p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal - /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64) - - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - group: DotNet-CLI-SDLValidation-Params - - template: /eng/common/templates/variables/pool-providers.yml +- template: /eng/pipelines/templates/variables/sdk-defaults.yml +# Variables used: DncEngPublicBuildPool +- template: /eng/common/templates/variables/pool-providers.yml + +resources: + containers: + - container: alpine319WithNode + image: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.19-WithNode + - container: centosStream9 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9 + - container: debian12Amd64 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-gcc14-amd64 + - container: fedora39 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-39 + - container: ubuntu2204DebPkg + image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-debpkg stages: +############### BUILD STAGE ############### - stage: build displayName: Build jobs: - - job: Publish_Build_Configuration - pool: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - vmImage: 'windows-2019' - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - name: $(DncEngInternalBuildPool) - demands: ImageOverride -equals windows.vs2019.amd64 - steps: - - publish: $(Build.SourcesDirectory)\eng\BuildConfiguration - artifact: BuildConfiguration - displayName: Publish Build Config - - template: /eng/build-pr.yml + ############### WINDOWS ############### + - template: /eng/pipelines/templates/jobs/sdk-job-matrix.yml@self + parameters: + pool: + name: $(DncEngPublicBuildPool) + demands: ImageOverride -equals windows.vs2022.amd64.open + os: windows + helixTargetQueue: windows.amd64.vs2022.pre.open + + ############### LINUX ############### + - template: /eng/pipelines/templates/jobs/sdk-job-matrix.yml parameters: - agentOs: Windows_NT pool: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - name: $(DncEngPublicBuildPool) - demands: ImageOverride -equals 1es-windows-2022-open - ${{ if ne(variables['System.TeamProject'], 'public') }}: - name: $(DncEngInternalBuildPool) - demands: ImageOverride -equals 1es-windows-2022 - ${{ if eq(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: Windows.Amd64.VS2022.Pre.Open - ${{ if ne(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: Windows.Amd64.VS2022.Pre - strategy: - matrix: - Build_Release: - _BuildConfig: Release - _PublishArgs: '-publish /p:DotNetPublishUsingPipelines=true' - ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}: - _SignType: test - _Test: -test - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - _SignType: real - _Test: '' + name: $(DncEngPublicBuildPool) + demands: ImageOverride -equals build.ubuntu.2204.amd64.open + os: linux + helixTargetQueue: ubuntu.2204.amd64.open + + ############### MACOS ############### + - template: /eng/pipelines/templates/jobs/sdk-job-matrix.yml + parameters: + pool: + name: Azure Pipelines + vmImage: macOS-latest + os: macOS + helixTargetQueue: osx.13.amd64.open + + ############### SOURCE BUILD ############### - template: /eng/common/templates/job/source-build.yml parameters: enableInternalSources: true platform: - name: 'Managed' - container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9' - - ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}: - - template: /eng/build-pr.yml - parameters: - agentOs: Windows_NT_FullFramework - pool: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - name: $(DncEngPublicBuildPool) - demands: ImageOverride -equals 1es-windows-2022-open - ${{ if ne(variables['System.TeamProject'], 'public') }}: - name: $(DncEngInternalBuildPool) - demands: ImageOverride -equals windows.vs2022preview.amd64 - ${{ if eq(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: Windows.Amd64.VS2022.Pre.Open - ${{ if ne(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: Windows.Amd64.VS2022.Pre - strategy: - matrix: - Build_Debug: - _BuildConfig: Debug - _PublishArgs: '' - _SignType: test - _Test: -test - - - template: /eng/build-pr.yml - parameters: - agentOs: Windows_NT_TestAsTools - pool: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - vmImage: 'windows-2019' - ${{ if ne(variables['System.TeamProject'], 'public') }}: - name: $(DncEngInternalBuildPool) - demands: ImageOverride -equals windows.vs2019.amd64 - strategy: - matrix: - Build_Debug: - _BuildConfig: Debug - _PublishArgs: '' - _SignType: test + name: Managed + container: centosStream9 + jobProperties: + timeoutInMinutes: 30 - - template: /eng/build-pr.yml - parameters: - agentOs: Ubuntu_22_04 - pool: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - vmImage: 'ubuntu-22.04' - ${{ if ne(variables['System.TeamProject'], 'public') }}: - name: $(DncEngInternalBuildPool) - demands: ImageOverride -equals build.ubuntu.2204.amd64 - ${{ if eq(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: ubuntu.2204.amd64.open - ${{ if ne(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: Ubuntu.2204.Amd64 - strategy: - matrix: - Build_Release: - _BuildConfig: Release - _PublishArgs: '' - _SignType: test - _Test: -test - - - template: /eng/build-pr.yml - parameters: - agentOs: Darwin - pool: - vmImage: 'macOS-latest' - ${{ if eq(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: OSX.13.Amd64.Open - ${{ if ne(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: OSX.13.Amd64 - strategy: - matrix: - Build_Release: - _BuildConfig: Release - _PublishArgs: '' - _SignType: test - _Test: -test - - - template: /eng/template-engine.yml - - - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - template: /eng/common/templates/job/publish-build-assets.yml - parameters: - publishUsingPipelines: true - publishAssetsImmediately: true - dependsOn: - - Windows_NT - - Source_Build_Managed - pool: - name: $(DncEngInternalBuildPool) - demands: ImageOverride -equals windows.vs2019.amd64 -- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - template: /eng/common/templates/post-build/post-build.yml - parameters: - publishingInfraVersion: 3 - enableSymbolValidation: false - enableSigningValidation: false - enableNugetValidation: false - enableSourceLinkValidation: false - publishInstallersAndChecksums: true - publishAssetsImmediately: true - SDLValidationParameters: - enable: false - params: ' -SourceToolsList @("policheck","credscan") - -TsaInstanceURL $(_TsaInstanceURL) - -TsaProjectName $(_TsaProjectName) - -TsaNotificationEmail $(_TsaNotificationEmail) - -TsaCodebaseAdmin $(_TsaCodebaseAdmin) - -TsaBugAreaPath $(_TsaBugAreaPath) - -TsaIterationPath $(_TsaIterationPath) - -TsaRepositoryName "dotnet-sdk" - -TsaCodebaseName "dotnet-sdk" - -TsaPublish $True' + ############### DOTNET-FORMAT ############### + - template: /eng/dotnet-format/dotnet-format-integration.yml diff --git a/CODEOWNERS b/CODEOWNERS index 2766ef68dacb..4c48269fd3e0 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -9,86 +9,101 @@ # Area-WebSDK /src/WebSdk/ @vijayrkn -/src/Tests/Microsoft.NET.Sdk.Publish.Tasks.Tests/ @vijayrkn +/test/Microsoft.NET.Sdk.Publish.Tasks.Tests/ @vijayrkn # Area-AspNetCore /src/BlazorWasmSdk/ @dotnet/aspnet-blazor-eng -/src/Tests/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/ @dotnet/aspnet-blazor-eng -/src/Assets/TestProjects/BlazorHosted/ @dotnet/aspnet-blazor-eng -/src/Assets/TestProjects/BlazorHostedRID/ @dotnet/aspnet-blazor-eng -/src/Assets/TestProjects/BlazorWasmMinimal/ @dotnet/aspnet-blazor-eng -/src/Assets/TestProjects/BlazorWasmWithLibrary/ @dotnet/aspnet-blazor-eng -/src/RazorSdk/ @dotnet/aspnet-blazor-eng -/src/Tests/Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests/ @dotnet/aspnet-blazor-eng -/src/Tests/Microsoft.NET.Sdk.Razor.Tests/ @dotnet/aspnet-blazor-eng -/src/Tests/Microsoft.NET.Sdk.Razor.Tool.Tests/ @dotnet/aspnet-blazor-eng -/src/Assets/TestPackages/PackageLibraryDirectDependency/ @dotnet/aspnet-blazor-eng -/src/Assets/TestPackages/PackageLibraryTransitiveDependency/ @dotnet/aspnet-blazor-eng -/src/src/Assets/TestProjects/Razor*/ @dotnet/aspnet-blazor-eng +/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/ @dotnet/aspnet-blazor-eng +/test/TestAssets/TestProjects/BlazorHosted/ @dotnet/aspnet-blazor-eng +/test/TestAssets/TestProjects/BlazorHostedRID/ @dotnet/aspnet-blazor-eng +/test/TestAssets/TestProjects/BlazorWasmMinimal/ @dotnet/aspnet-blazor-eng +/test/TestAssets/TestProjects/BlazorWasmWithLibrary/ @dotnet/aspnet-blazor-eng +/src/RazorSdk/ @dotnet/razor-compiler +/test/Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests/ @dotnet/aspnet-blazor-eng +/test/Microsoft.NET.Sdk.Razor.Tests/ @dotnet/razor-compiler +/test/Microsoft.NET.Sdk.Razor.Tool.Tests/ @dotnet/razor-compiler +/test/TestAssets/TestPackages/PackageLibraryDirectDependency/ @dotnet/aspnet-blazor-eng +/test/TestAssets/TestPackages/PackageLibraryTransitiveDependency/ @dotnet/aspnet-blazor-eng +/test/TestAssets/TestProjects/Razor*/ @dotnet/razor-compiler # Area-Wasm -/src/WasmSdk @lewing @radical @pavelsavara @maraf +/src/WasmSdk @lewing @akoeplinger @pavelsavara @maraf # Area-Format /src/Cli/dotnet/commands/dotnet-format @sharwell @arkalyanms -/src/Tests/dotnet-format.Tests @sharwell @arkalyanms +/test/dotnet-format.Tests @sharwell @arkalyanms # Area-NuGet /src/Cli/dotnet/commands/dotnet-add/dotnet-add-package @dotnet/nuget-team -/src/Tests/dotnet-add-package.Tests @dotnet/nuget-team +/test/dotnet-add-package.Tests @dotnet/nuget-team /src/Cli/dotnet/commands/dotnet-nuget @dotnet/nuget-team -/src/Tests/dotnet-nuget.UnitTests @dotnet/nuget-team +/test/dotnet-nuget.UnitTests @dotnet/nuget-team +/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package @dotnet/nuget-team +/test/dotnet-list-package.Tests @dotnet/nuget-team # Area-FSharp /src/Cli/dotnet/commands/dotnet-fsi @dotnet/fsharp -/src/Tests/dotnet-fsi.Tests @dotnet/fsharp +/test/dotnet-fsi.Tests @dotnet/fsharp # Area-DotNet Test -/src/Cli/dotnet/commands/dotnet-test @dotnet/dotnet-test-templates-admin -/src/Cli/dotnet/commands/dotnet-vstest @dotnet/dotnet-test-templates-admin -/src/Tests/dotnet-test.Tests @dotnet/dotnet-test-templates-admin -/src/Tests/dotnet-vstest.Tests @dotnet/dotnet-test-templates-admin +/src/Cli/dotnet/commands/dotnet-test @dotnet/dotnet-testing-admin +/src/Cli/dotnet/commands/dotnet-vstest @dotnet/dotnet-testing-admin +/test/dotnet-test.Tests @dotnet/dotnet-testing-admin +/test/dotnet-vstest.Tests @dotnet/dotnet-testing-admin # Area-Templates -/src/Cli/dotnet/commands/dotnet-new @dotnet/templating-engine-maintainers -/src/Cli/dotnet-new3 @dotnet/templating-engine-maintainers -/src/Cli/Microsoft.TemplateEngine.Cli @dotnet/templating-engine-maintainers -/src/Tests/dotnet-new.Tests @dotnet/templating-engine-maintainers -/src/Tests/Microsoft.TemplateEngine.* @dotnet/templating-engine-maintainers -/template_feed @dotnet/templating-engine-maintainers +/src/Cli/dotnet/commands/dotnet-new @dotnet/templating-engine-maintainers +/src/Cli/dotnet-new3 @dotnet/templating-engine-maintainers +/src/Cli/Microsoft.TemplateEngine.Cli @dotnet/templating-engine-maintainers +/test/dotnet-new.Tests @dotnet/templating-engine-maintainers +/test/Microsoft.TemplateEngine.* @dotnet/templating-engine-maintainers +/template_feed @dotnet/templating-engine-maintainers # ILLink and ReadyToRun targets and tasks owned by runtime team # Area-ILLink Area-ReadyToRun -/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets clrappmodel@microsoft.com @dotnet/illink-contrib +/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets @dotnet/illink /src/Tasks/Microsoft.NET.Build.Tasks/PrepareForReadyToRunCompilation.cs @AntonLapounov /src/Tasks/Microsoft.NET.Build.Tasks/RunReadyToRunCompiler.cs @AntonLapounov -/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs clrappmodel@microsoft.com @dotnet/illink-contrib -/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishReadyToRun.cs @AntonLapounov +/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs @dotnet/illink +/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishReadyToRun.cs @AntonLapounov # Publish.targets related to ILLink and ReadyToRun is own by both runtime and SDK team -/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets clrappmodel@microsoft.com @dotnet/illink-contrib @AntonLapounov @dotnet/dotnet-cli +/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets @dotnet/illink @AntonLapounov @dotnet/dotnet-cli +# Area-ClickOnce /src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ClickOnce.targets @sujitnayak # Area-Watch -/src/Assets/TestProjects/Watch*/ @tmat @arkalyanms @dotnet/roslyn-ide -/src/Tests/dotnet-watch.Tests/ @tmat @arkalyanms @dotnet/roslyn-ide -/src/Tests/Microsoft.AspNetCore.Watch.BrowserRefresh.Tests/ @dotnet/aspnet-blazor-eng -/src/BuiltInTools/* @tmat @arkalyanms @dotnet/roslyn-ide -/src/BuiltInTools/BrowserRefresh @dotnet/aspnet-blazor-eng - -# ApiCompat tools owned by runtime team -# Area-ApiCompat -/src/ApiCompat/ @ericstj @dotnet/area-infrastructure-libraries @joperezr -/src/Tests/Microsoft.DotNet.ApiCompatibility*/ @ericstj @dotnet/area-infrastructure-libraries @joperezr -/src/Tests/Microsoft.DotNet.ApiCompat*/ @ericstj @dotnet/area-infrastructure-libraries @joperezr -/src/Tests/Microsoft.DotNet.PackageValidation*/ @ericstj @dotnet/area-infrastructure-libraries @joperezr +/test/TestAssets/TestProjects/Watch*/ @tmat @arkalyanms @dotnet/roslyn-ide +/test/dotnet-watch.Tests/ @tmat @arkalyanms @dotnet/roslyn-ide +/test/Microsoft.AspNetCore.Watch.BrowserRefresh.Tests/ @dotnet/aspnet-blazor-eng +/src/BuiltInTools/* @tmat @arkalyanms @dotnet/roslyn-ide +/src/BuiltInTools/BrowserRefresh @dotnet/aspnet-blazor-eng +/src/BuiltInTools/AspireService @BillHiebert @dotnet/aspnet-blazor-eng + +# Compatibility tools owned by runtime team +/src/Compatibility/ @dotnet/area-infrastructure-libraries +/test/Microsoft.DotNet.ApiCompatibility*/ @dotnet/area-infrastructure-libraries +/test/Microsoft.DotNet.ApiCompat*/ @dotnet/area-infrastructure-libraries +/test/Microsoft.DotNet.PackageValidation*/ @dotnet/area-infrastructure-libraries # Area-GenAPI -/src/GenAPI/ @andriipatsula @dotnet/area-infrastructure-libraries -/src/Tests/Microsoft.DotNet.GenAPI/ @andriipatsula @dotnet/area-infrastructure-libraries -/src/Microsoft.DotNet.ApiSymbolExtensions/ @andriipatsula @dotnet/area-infrastructure-libraries +/src/Compatibility/GenAPI/ @dotnet/area-infrastructure-libraries +/src/Compatibility/Microsoft.DotNet.ApiSymbolExtensions/ @dotnet/area-infrastructure-libraries +/test/Microsoft.DotNet.GenAPI/ @dotnet/area-infrastructure-libraries +/test/Microsoft.DotNet.ApiSymbolExtensions.Tests/ @dotnet/area-infrastructure-libraries # Area: dotnet containers /src/Cli/Containers @dotnet/sdk-container-builds-maintainers -/src/Tests/containerize.UnitTests @dotnet/sdk-container-builds-maintainers -/src/Tests/Microsoft.NET.Build.Containers.IntegrationTests @dotnet/sdk-container-builds-maintainers -/src/Tests/Microsoft.NET.Build.Containers.UnitTests @dotnet/sdk-container-builds-maintainers +/test/containerize.UnitTests @dotnet/sdk-container-builds-maintainers +/test/Microsoft.NET.Build.Containers.IntegrationTests @dotnet/sdk-container-builds-maintainers +/test/Microsoft.NET.Build.Containers.UnitTests @dotnet/sdk-container-builds-maintainers + +# dotnet-format +/src/BuiltInTools/dotnet-format @dotnet/roslyn-ide +/test/dotnet-format.Tests @dotnet/roslyn-ide + +# Area: VMR & SourceBuild +/.devcontainer/ @dotnet/source-build +/eng/pipelines/ @dotnet/source-build @dotnet/product-construction +/eng/SourceBuild* @dotnet/source-build +/src/SourceBuild/ @dotnet/source-build @dotnet/product-construction +/src/VirtualMonoRepo/ @dotnet/product-construction diff --git a/Directory.Build.props b/Directory.Build.props index ae3882f1df94..90b657484e81 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,8 +1,31 @@ - + + + + + $([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant()) + $(BuildArchitecture) + $(BuildArchitecture) + $(BuildArchitecture) + $(BuildArchitecture) + x64 + + + $(Architecture) + + + + true + -pgo + + MIT Latest @@ -11,31 +34,26 @@ true false - net8.0 + net9.0 $(SdkTargetFramework) - - - net8.0 - - $(SdkTargetFramework) + net8.0 + + + $(SdkTargetFramework) $(NoWarn);NU1701;NU1507 - - $(NoWarn);CA2009 - true + true true $(DefineConstants);CI_BUILD $(DefineConstants);MICROSOFT_ENABLE_TELEMETRY - $(DefineConstants);DOT_NET_BUILD_FROM_SOURCE + $(DefineConstants);DOT_NET_BUILD_FROM_SOURCE true true diff --git a/Directory.Build.targets b/Directory.Build.targets index 4a5e303b20db..d0e9024e3a1d 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -46,7 +46,8 @@ + and '$(MSBuildProjectName)' != 'toolset-tasks' + and '$(MSBuildProjectName)' != 'core-sdk-tasks'"> + + + $(NoWarn);NU1507 + - @@ -11,18 +14,27 @@ + + - - + + + - + + + + + + + @@ -32,12 +44,18 @@ + + + + + + @@ -46,11 +64,12 @@ + - + @@ -61,11 +80,10 @@ - + - - + @@ -73,8 +91,8 @@ - + @@ -82,8 +100,6 @@ - - @@ -99,7 +115,6 @@ - @@ -114,15 +129,15 @@ - - + + - + - - - - + + + + - + - + diff --git a/NuGet.config b/NuGet.config index b0ce037d2a1c..8964b65df5ca 100644 --- a/NuGet.config +++ b/NuGet.config @@ -3,36 +3,24 @@ + + - - - - - - - - - - - - - + - + - - @@ -40,6 +28,9 @@ + + + @@ -49,30 +40,16 @@ - - - - - - - - - - - - - - diff --git a/README.md b/README.md index 4ec85183861d..e25ac7efa921 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## Welcome to dotnet sdk -This repository contains core functionality needed to create .NET projects that is shared between Visual Studio and the [.NET CLI](https://learn.microsoft.com/dotnet/core/tools/). +This repository contains core functionality needed to create .NET projects that are shared between Visual Studio and the [.NET CLI](https://learn.microsoft.com/dotnet/core/tools/). * MSBuild tasks are under [/src/Tasks/Microsoft.NET.Build.Tasks/](src/Tasks/Microsoft.NET.Build.Tasks). @@ -10,14 +10,48 @@ Common project and item templates are found in [template_feed](https://github.co ## Build status -|Windows x64 | -|:------:| -|[![](https://dev.azure.com/dnceng/internal/_apis/build/status/dotnet/sdk/DotNet-Core-Sdk%203.0%20(Windows)%20(YAML)%20(Official))](https://dev.azure.com/dnceng/internal/_build?definitionId=140)| +Visibility|All jobs| +|:------|:------| +|Public|[![Status](https://dev.azure.com/dnceng-public/public/_apis/build/status/101)](https://dev.azure.com/dnceng-public/public/_build?definitionId=101)| +|Microsoft Internal|[![Status](https://dev.azure.com/dnceng/internal/_apis/build/status/140)](https://dev.azure.com/dnceng/internal/_build?definitionId=140)| ## Installing the SDK -[Official builds](https://dotnet.microsoft.com/download/dotnet-core) -[Latest builds](https://github.com/dotnet/installer#installers-and-binaries) +You can download the .NET SDK as either an installer (MSI, PKG) or a zip (zip, tar.gz). The .NET SDK contains both the .NET runtime and CLI tools. + +- [Official builds](https://dotnet.microsoft.com/download/dotnet) +- [**Latest builds table**](documentation/package-table.md) + +> [!NOTE] +> When acquiring installers from the latest builds table, be aware that the installers are the **latest bits**. With development builds, internal NuGet feeds are necessary for some scenarios (for example, to acquire the runtime pack for self-contained apps). You can use the following NuGet.config to configure these feeds. See the following document [Configuring NuGet behavior](https://docs.microsoft.com/nuget/consume-packages/configuring-nuget-behavior) for more information on where to modify your NuGet.config to apply the changes. + +### For .NET 9 builds +```xml + + + + + +``` + +### For .NET 8 builds +```xml + + + + + +``` + +### Debian package dependencies + +Our Debian packages are put together slightly differently than the other OS specific installers. Instead of combining everything, we have separate component packages that depend on each other. If you're installing the SDK from the .deb file (via dpkg or similar), then you'll need to install the corresponding dependencies first: +- [Host, Host FX Resolver, and Shared Framework](https://github.com/dotnet/runtime/blob/main/docs/project/dogfooding.md#daily-builds-table) +- [ASP.NET Core Shared Framework](https://github.com/dotnet/aspnetcore/blob/main/docs/DailyBuilds.md) + +### Looking for dotnet-install sources? + +Sources for dotnet-install.sh and dotnet-install.ps1 are in the [install-scripts repo](https://github.com/dotnet/install-scripts). ## How do I engage and contribute? @@ -56,3 +90,9 @@ For PRs, we assign a reviewer once a week on Wednesday, looking only at PRs that * Get the PR green. * Include a test if possible. * Mention `@dotnet-cli` if you want to raise visibility of the PR. + +## License + +The .NET SDK project uses the [MIT license](LICENSE.TXT). + +The *LICENSE.txt* and *ThirdPartyNotices.txt* in any downloaded archives are authoritative. \ No newline at end of file diff --git a/THIRD-PARTY-NOTICES.TXT b/THIRD-PARTY-NOTICES.TXT new file mode 100644 index 000000000000..859bd1a6d9cd --- /dev/null +++ b/THIRD-PARTY-NOTICES.TXT @@ -0,0 +1,11 @@ +.NET Core uses third-party libraries or other resources that may be +distributed under licenses different than the .NET Core software. + +In the event that we accidentally failed to list a required notice, please +bring it to our attention. Post an issue or email us: + + dotnet@microsoft.com + +The attached notices are provided for information only. + +No notices are provided at this time. \ No newline at end of file diff --git a/TemplateEngine.slnf b/TemplateEngine.slnf index a0e08c00d79c..20dc80713770 100644 --- a/TemplateEngine.slnf +++ b/TemplateEngine.slnf @@ -2,7 +2,7 @@ "solution": { "path": "sdk.sln", "projects": [ - "src\\Assets\\TestPackages\\dotnet-new\\Microsoft.TemplateEngine.TestTemplates.csproj", + "test\\TestAssets\\TestPackages\\dotnet-new\\Microsoft.TemplateEngine.TestTemplates.csproj", "src\\Cli\\Microsoft.DotNet.Cli.Sln.Internal\\Microsoft.DotNet.Cli.Sln.Internal.csproj", "src\\Cli\\Microsoft.DotNet.Cli.Utils\\Microsoft.DotNet.Cli.Utils.csproj", "src\\Cli\\Microsoft.DotNet.Configurer\\Microsoft.DotNet.Configurer.csproj", @@ -14,12 +14,12 @@ "src\\Microsoft.Win32.Msi\\Microsoft.Win32.Msi.csproj", "src\\Resolvers\\Microsoft.DotNet.NativeWrapper\\Microsoft.DotNet.NativeWrapper.csproj", "src\\Resolvers\\Microsoft.DotNet.SdkResolver\\Microsoft.DotNet.SdkResolver.csproj", - "src\\Tests\\Microsoft.NET.TestFramework\\Microsoft.NET.TestFramework.csproj", - "src\\Tests\\Microsoft.TemplateEngine.Cli.UnitTests\\Microsoft.TemplateEngine.Cli.UnitTests.csproj", - "src\\Tests\\dotnet-new.Tests\\dotnet-new.IntegrationTests.csproj", - "src\\Tests\\dotnet.Tests\\dotnet.Tests.csproj", + "test\\Microsoft.NET.TestFramework\\Microsoft.NET.TestFramework.csproj", + "test\\Microsoft.TemplateEngine.Cli.UnitTests\\Microsoft.TemplateEngine.Cli.UnitTests.csproj", + "test\\dotnet-new.Tests\\dotnet-new.IntegrationTests.csproj", + "test\\dotnet.Tests\\dotnet.Tests.csproj", "template_feed\\Microsoft.DotNet.Common.ItemTemplates\\Microsoft.DotNet.Common.ItemTemplates.csproj", - "template_feed\\Microsoft.DotNet.Common.ProjectTemplates.8.0\\Microsoft.DotNet.Common.ProjectTemplates.8.0.csproj" + "template_feed\\Microsoft.DotNet.Common.ProjectTemplates.9.0\\Microsoft.DotNet.Common.ProjectTemplates.9.0.csproj" ] } } \ No newline at end of file diff --git a/build.cmd b/build.cmd index 6a89aa523ac8..132cbefcda29 100644 --- a/build.cmd +++ b/build.cmd @@ -1,3 +1,12 @@ @echo off -powershell -NoLogo -NoProfile -ExecutionPolicy ByPass -Command "& """%~dp0eng\common\build.ps1""" -build -restore %*" + +echo %* | findstr /C:"-pack" >nul +if %errorlevel%==0 ( + set PackInstaller= +) else ( + REM disable crossgen for inner-loop builds to save a ton of time + set PackInstaller=/p:PackInstaller=false + set DISABLE_CROSSGEN=true +) +powershell -NoLogo -NoProfile -ExecutionPolicy ByPass -command "& """%~dp0eng\common\build.ps1""" -restore -build -nativeToolsOnMachine -msbuildEngine dotnet %PackInstaller% %*" exit /b %ErrorLevel% diff --git a/build.sh b/build.sh index f9a7889f52c8..0d8b76aca39e 100755 --- a/build.sh +++ b/build.sh @@ -8,4 +8,12 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli done ScriptRoot="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -. "$ScriptRoot/eng/common/build.sh" --build --restore "$@" +if [[ "$@" != *"-pack"* ]]; then + # disable crossgen for inner-loop builds to save a ton of time + export DISABLE_CROSSGEN=true + packInstallerFlag="/p:PackInstaller=false" +else + packInstallerFlag= +fi + +. "$ScriptRoot/eng/common/build.sh" --build --restore $packInstallerFlag "$@" diff --git a/build/RunTestsOnHelix.cmd b/build/RunTestsOnHelix.cmd index c414a43205f3..f55fcf1ead42 100644 --- a/build/RunTestsOnHelix.cmd +++ b/build/RunTestsOnHelix.cmd @@ -10,9 +10,6 @@ set PATH=%DOTNET_ROOT%;%PATH% set DOTNET_MULTILEVEL_LOOKUP=0 set TestFullMSBuild=%1 -set TestExecutionDirectory=%CD%\testExecutionDirectory -mkdir %TestExecutionDirectory% - REM Use powershell to call partical Arcade logic to get full framework msbuild path and assign it if "%TestFullMSBuild%"=="true" ( FOR /F "tokens=*" %%g IN ('PowerShell -ExecutionPolicy ByPass -File "%HELIX_CORRELATION_PAYLOAD%\t\eng\print-full-msbuild-path.ps1"') do (SET DOTNET_SDK_TEST_MSBUILD_PATH=%%g) @@ -23,11 +20,12 @@ FOR /F "tokens=*" %%g IN ('PowerShell -ExecutionPolicy ByPass [System.IO.Path]:: set TestExecutionDirectory=%TEMP%\dotnetSdkTests\%RandomDirectoryName% set DOTNET_CLI_HOME=%TestExecutionDirectory%\.dotnet mkdir %TestExecutionDirectory% -robocopy %HELIX_CORRELATION_PAYLOAD%\t\TestExecutionDirectoryFiles %TestExecutionDirectory% /s +REM https://stackoverflow.com/a/7487697/294804 +robocopy %HELIX_CORRELATION_PAYLOAD%\t\TestExecutionDirectoryFiles %TestExecutionDirectory% /s /nfl /ndl /njh /njs /np set DOTNET_SDK_TEST_EXECUTION_DIRECTORY=%TestExecutionDirectory% set DOTNET_SDK_TEST_MSBUILDSDKRESOLVER_FOLDER=%HELIX_CORRELATION_PAYLOAD%\r -set DOTNET_SDK_TEST_ASSETS_DIRECTORY=%TestExecutionDirectory%\assets +set DOTNET_SDK_TEST_ASSETS_DIRECTORY=%TestExecutionDirectory%\TestAssets REM call dotnet new so the first run message doesn't interfere with the first test dotnet new --debug:ephemeral-hive @@ -36,6 +34,7 @@ REM We downloaded a special zip of files to the .nuget folder so add that as a s dotnet nuget list source --configfile %TestExecutionDirectory%\nuget.config PowerShell -ExecutionPolicy ByPass "dotnet nuget locals all -l | ForEach-Object { $_.Split(' ')[1]} | Where-Object{$_ -like '*cache'} | Get-ChildItem -Recurse -File -Filter '*.dat' | Measure" dotnet nuget add source %DOTNET_ROOT%\.nuget --configfile %TestExecutionDirectory%\nuget.config +if exist %TestExecutionDirectory%\Testpackages dotnet nuget add source %TestExecutionDirectory%\Testpackages --name testpackages --configfile %TestExecutionDirectory%\nuget.config dotnet nuget remove source dotnet6-transport --configfile %TestExecutionDirectory%\nuget.config dotnet nuget remove source dotnet6-internal-transport --configfile %TestExecutionDirectory%\nuget.config @@ -48,8 +47,3 @@ dotnet nuget remove source dotnet-tools-transport --configfile %TestExecutionDir dotnet nuget remove source dotnet-libraries --configfile %TestExecutionDirectory%\nuget.config dotnet nuget remove source dotnet-eng --configfile %TestExecutionDirectory%\nuget.config dotnet nuget list source --configfile %TestExecutionDirectory%\nuget.config - -robocopy %HELIX_CORRELATION_PAYLOAD%\t\TestExecutionDirectoryFiles\ .\ testAsset.props -set TestPackagesRoot=%CD%\assets\testpackages\ -dotnet build assets\testpackages\Microsoft.NET.TestPackages.csproj /t:Build -p:VersionPropsIsImported=false -robocopy .\assets\testpackages\testpackages %TestExecutionDirectory%\TestPackages /s \ No newline at end of file diff --git a/build/RunTestsOnHelix.sh b/build/RunTestsOnHelix.sh index 19cf656937ad..9474b2fcf119 100644 --- a/build/RunTestsOnHelix.sh +++ b/build/RunTestsOnHelix.sh @@ -16,7 +16,7 @@ cp -a $HELIX_CORRELATION_PAYLOAD/t/TestExecutionDirectoryFiles/. $TestExecutionD export DOTNET_SDK_TEST_EXECUTION_DIRECTORY=$TestExecutionDirectory export DOTNET_SDK_TEST_MSBUILDSDKRESOLVER_FOLDER=$HELIX_CORRELATION_PAYLOAD/r -export DOTNET_SDK_TEST_ASSETS_DIRECTORY=$TestExecutionDirectory/Assets +export DOTNET_SDK_TEST_ASSETS_DIRECTORY=$TestExecutionDirectory/TestAssets # call dotnet new so the first run message doesn't interfere with the first test dotnet new --debug:ephemeral-hive @@ -24,6 +24,7 @@ dotnet new --debug:ephemeral-hive # We downloaded a special zip of files to the .nuget folder so add that as a source dotnet nuget list source --configfile $TestExecutionDirectory/NuGet.config dotnet nuget add source $DOTNET_ROOT/.nuget --configfile $TestExecutionDirectory/NuGet.config +dotnet nuget add source $TestExecutionDirectory/Testpackages --configfile $TestExecutionDirectory/NuGet.config #Remove feeds not needed for tests dotnet nuget remove source dotnet6-transport --configfile $TestExecutionDirectory/NuGet.config dotnet nuget remove source dotnet6-internal-transport --configfile $TestExecutionDirectory/NuGet.config @@ -35,12 +36,4 @@ dotnet nuget remove source dotnet-libraries-transport --configfile $TestExecutio dotnet nuget remove source dotnet-tools-transport --configfile $TestExecutionDirectory/NuGet.config dotnet nuget remove source dotnet-libraries --configfile $TestExecutionDirectory/NuGet.config dotnet nuget remove source dotnet-eng --configfile $TestExecutionDirectory/NuGet.config -dotnet nuget list source --configfile $TestExecutionDirectory/NuGet.config - -cp $HELIX_CORRELATION_PAYLOAD/t/TestExecutionDirectoryFiles/testAsset.props ./ -export TestPackagesRoot=$(pwd)/Assets/TestPackages -dotnet build ./Assets/TestPackages/Microsoft.NET.TestPackages.csproj /t:Build -p:VersionPropsIsImported=false -mkdir $TestExecutionDirectory/Testpackages -cp -v $TestPackagesRoot/TestPackages/* $TestExecutionDirectory/Testpackages/. -dotnet nuget add source $TestExecutionDirectory/Testpackages --configfile $TestExecutionDirectory/NuGet.config - +dotnet nuget list source --configfile $TestExecutionDirectory/NuGet.config \ No newline at end of file diff --git a/containers.slnf b/containers.slnf index a11c0fd22a92..c18d1b752409 100644 --- a/containers.slnf +++ b/containers.slnf @@ -7,10 +7,10 @@ "src\\Containers\\Microsoft.NET.Build.Containers\\Microsoft.NET.Build.Containers.csproj", "src\\Containers\\containerize\\containerize.csproj", "src\\Containers\\packaging\\package.csproj", - "src\\Tests\\Microsoft.NET.Build.Containers.IntegrationTests\\Microsoft.NET.Build.Containers.IntegrationTests.csproj", - "src\\Tests\\Microsoft.NET.Build.Containers.UnitTests\\Microsoft.NET.Build.Containers.UnitTests.csproj", - "src\\Tests\\Microsoft.NET.TestFramework\\Microsoft.NET.TestFramework.csproj", - "src\\Tests\\containerize.UnitTests\\containerize.UnitTests.csproj" + "test\\Microsoft.NET.Build.Containers.IntegrationTests\\Microsoft.NET.Build.Containers.IntegrationTests.csproj", + "test\\Microsoft.NET.Build.Containers.UnitTests\\Microsoft.NET.Build.Containers.UnitTests.csproj", + "test\\Microsoft.NET.TestFramework\\Microsoft.NET.TestFramework.csproj", + "test\\containerize.UnitTests\\containerize.UnitTests.csproj" ] } } \ No newline at end of file diff --git a/documentation/format/docs/3rd-party-analyzers.md b/documentation/format/docs/3rd-party-analyzers.md new file mode 100644 index 000000000000..6bd606478a6a --- /dev/null +++ b/documentation/format/docs/3rd-party-analyzers.md @@ -0,0 +1,39 @@ +# 3rd Party Analyzers + +## How to add analyzers to a project + +3rd party analyzers are discovered from the `` specified in the workspace project files. + +*Example:* + +Add the StyleCop analyzer package to a simple console project file. + +```diff + + + + Exe + netcoreapp3.1 + + ++ ++ ++ + + +``` + +## How to configure analyzer severity + +The options specified in .editorconfig files are recognized by the pattern `dotnet_diagnostic..severity = `. `` represents the diagnostic ID matched by the compiler, case-insensitively, to be configured. `` must be one of the following: error, warn, info, hidden, suppress. Please read the [Code Analysis documentation](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/configuration-options#severity-level) for more details. + +*Example:* + +Configure the StyleCop analyzer so that empty comments are errors. + +```ini +[*.{cs,vb}] + +# The C# comment does not contain any comment text. +dotnet_diagnostic.SA1120.severity = error +``` \ No newline at end of file diff --git a/documentation/format/docs/README.md b/documentation/format/docs/README.md new file mode 100644 index 000000000000..39a298411a5b --- /dev/null +++ b/documentation/format/docs/README.md @@ -0,0 +1,125 @@ +# Welcome to the dotnet-format docs! + +## .editorconfig options +- [Supported .editorconfig options](./Supported-.editorconfig-options.md) + +## CLI options + +### Specify a workspace (Required) + +A workspace path is needed when running dotnet-format. By default, the current folder will be used as the workspace path. The workspace path and type of workspace determines which code files are considered for formatting. + +- Solutions and Projects - By default dotnet-format will open the workspace path as a MSBuild solution or project. +- `--no-restore` - When formatting a solution or project the no restore option will stop dotnet-format from performing an implicit package restore. +- `--folder` - When the folder options is specified the workspace path will be treated as a folder of code files. + +*Example:* + +Format the code files used in the format solution. + +```console +dotnet format ./format.sln +``` + +Format the code files used in the dotnet-format project. + +```console +dotnet format ./src/dotnet-format.csproj +``` + +Format the code files from the `./src` folder. + +```console +dotnet format whitespace ./src --folder +``` + +### Whitespace formatting + +Whitespace formatting includes the core .editorconfig settings along with the placement of spaces and newlines. The whitespace formatter is run by default when not running analysis. When only performing whitespace formatting, an implicit restore is not perfomed. When you want to run analysis and fix formatting issues you must specify both. + +Whitespace formatting run by default along with code-style and 3rd party analysis. + +```console +dotnet format ./format.sln +``` + +Running the whitespace formatter alone. + +```console +dotnet format whitespace ./format.sln +``` + +### Running analysis + +#### CodeStyle analysis + +Running codestyle analysis requires the use of a MSBuild solution or project file as the workspace. By default an implicit restore on the solution or project is performed. Enforces the .NET [Language conventions](https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019) and [Naming conventions](https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions?view=vs-2019). + +- `dotnet format style --severity ` - Runs analysis and attempts to fix issues with severity equal or greater than specified. If severity is not specified then severity defaults to warning. + +*Example:* + +Code-style analysis is run by default along with whitespace formatting and 3rd party analysis. + +```console +dotnet format ./format.sln +``` + +Run code-style analysis alone against the dotnet-format project. + +```console +dotnet format style ./src/dotnet-format.csproj --severity error +``` + +Errors when used with the `--folder` option. Analysis requires a MSBuild solution or project. + +```console +dotnet format style ./src --folder +``` + +#### 3rd party analysis + +Running 3rd party analysis requires the use of a MSBuild solution or project file as the workspace. By default an implicit restore on the solution or project is performed. 3rd party analyzers are discovered from the `` specified in the workspace project files. + +- `dotnet format analyzers --severity ` - Runs analysis and attempts to fix issues with severity equal or greater than specified. If no severity is specified then this defaults to warning. + +#### Filter diagnostics to fix + +Typically when running codestyle or 3rd party analysis, all diagnostics of sufficient severity are reported and fixed. The `--diagnostics` option allows you to target a particular diagnostic or set of diagnostics of sufficient severity. + +- `--diagnostics ` - When used in conjunction with `style` or `analyzer` subcommands, allows you to apply targeted fixes for particular analyzers. + +*Example:* + +Run code-style analysis and fix unused using directive errors. + +```console +dotnet format style ./format.sln --diagnostics IDE0005 +``` + +### Filter files to format + +You can further narrow the list of files to be formatted by specifying a list of paths to include or exclude. When specifying folder paths the path must end with a directory separator. File globbing is supported. + +- `--include` - A list of relative file or folder paths to include in formatting. +- `--exclude` - A list of relative file or folder paths to exclude from formatting. + +*Example:* + +Other repos built as part of your project can be included using git submodules. These submodules likely contain their own .editorconfig files that are set as `root = true`. This makes it difficult to validate formatting for your project as formatting mistakes in submodules are treated as errors. + +The following command sets the repo folder as the workspace. It then includes the `src` and `tests` folders for formatting. The `submodule-a` folder is excluded from the formatting validation. + +```console +dotnet format whitespace --folder --include ./src/ ./tests/ --exclude ./src/submodule-a/ --verify-no-changes +``` + +### Logging and Reports + +- `--verbosity` - Set the verbosity level. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] +- `--report` - Writes a json file to the given directory. Defaults to 'format-report.json' if no filename given. +- `--binarylog` - Writes a [binary log file](https://msbuildlog.com/) to help in diagnosing solution or project load errors. Defaults to 'format.binlog' if no filename given. + +### Validate formatting + +- `--verify-no-changes` - Formats files without saving changes to disk. Terminates with a non-zero exit code (`2`) if any files were formatted. diff --git a/documentation/format/docs/Supported-.editorconfig-options.md b/documentation/format/docs/Supported-.editorconfig-options.md new file mode 100644 index 000000000000..e4a184e99514 --- /dev/null +++ b/documentation/format/docs/Supported-.editorconfig-options.md @@ -0,0 +1,31 @@ +# Supported .editorconfig options +The dotnet-format global tool supports the core set of [EditorConfig options](https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties)* as well as the [.NET coding convention settings for EditorConfig](https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2019). + +## Core options +- indent_style +- indent_size +- tab_width +- end_of_line +- charset +- insert_final_newline +- root + +[*] The options `trim_trailing_whitespace` and `max_line_length` are not supported. Currently insignificant whitespace is **always** removed by the formatter. + +## Removing unnecessary imports +In order to remove unnecessary imports the IDE0005 (unnecessary import) diagnostic id must be configured in your .editorconfig. When running dotnet-format specify a severity that includes the configured IDE0005 severity. + +*Example:* + +.editorconfig +```ini +root = true + +[*.{cs,vb}] +dotnet_diagnostic.IDE0005.severity = warning +``` + +command +```console +dotnet format ./format.sln --severity warn +``` \ No newline at end of file diff --git a/documentation/format/docs/integrations.md b/documentation/format/docs/integrations.md new file mode 100644 index 000000000000..3649e0603489 --- /dev/null +++ b/documentation/format/docs/integrations.md @@ -0,0 +1,90 @@ +# Integrations +Collection of advice how to auto check/format. Every sample expects dotnet format installed as local tool, unless otherwise noted. + +## Git pre-commit hook to reformat + +Create file `.git/hooks/pre-commit` with following contents: +```sh +#!/bin/sh +LC_ALL=C +# Select files to format +FILES=$(git diff --cached --name-only --diff-filter=ACM "*.cs" | sed 's| |\\ |g') +[ -z "$FILES" ] && exit 0 + +# Format all selected files +echo "$FILES" | cat | xargs | sed -e 's/ /,/g' | xargs dotnet format --include + +# Add back the modified files to staging +echo "$FILES" | xargs git add + +exit 0 + +``` + +These instructions originally authored by [randulakoralage82](https://medium.com/@randulakoralage82/format-your-net-code-with-git-hooks-a0dc33f68048). + + +## Check on PR in Azure Dev Ops + +Add following to your build file: + +```yaml +- task: UseDotNet@2 + displayName: 'Use .NET 6 sdk' + inputs: + packageType: 'sdk' + version: '6.0.x' + includePreviewVersions: true + +- task: DotNetCoreCLI@2 + displayName: 'dotnet-format' + inputs: + command: 'custom' + custom: 'format' + arguments: '--verify-no-changes' +``` + +These instructions originally authored by [leotsarev](https://github.com/joinrpg/joinrpg-net/). + + +## [pre-commit.com](https://pre-commit.com/) hook to reformat + +Add the following block to the `repos` section of your `.pre-commit-config.yaml` file: + +```yaml +- repo: https://github.com/dotnet/format + rev: "" # Specify a tag or sha here, or run "pre-commit autoupdate" + hooks: + - id: dotnet-format +``` +Note that this will compile and install dotnet format to an isolated environment, using the system installation of the dotnet CLI. See the [pre-commit.com documentation](https://pre-commit.com/#dotnet) for more details. The problem is that dotnet format is using *preview* SDK (even for 5.x versions), and you have to install preview SDK on your machine for compiling it. Another option is to use local feature of pre-commit, as follows: + +```yaml +- repo: local + hooks: + #Use dotnet format already installed on your machine + - id: dotnet-format + name: dotnet-format + language: system + entry: dotnet format --include + types_or: ["c#", "vb"] +``` + +These instructions originally authored by [rkm](https://github.com/rkm) & [leotsarev](https://github.com/joinrpg/joinrpg-net/). + + +## Rider reformat on save + +1. Open Settings -> Tools -> File Watchers +1. Press The “Plus Sign” to Add a Custom watcher +1. Set the name to i.e. “dotnet format on save” +1. FileType: C# +1. Scope: Open Files +1. Program: Write dotnet-format +1. Arguments: $SolutionPath$ --verbosity diagnostic --include $FileRelativePath$ +1. (Optionally) Append --fix-style warning to fix any style issues automatically on save. +1. (Optionally) Append --fix-analyzers warning to fix any analyzer warnings on save. +1. Disable all advanced option checkboxes. +1. All other values were left default + +These instructions originally authored by [Nils Henrik Hals](https://strepto.github.io/Pause/blog/dotnet-format-rider/). diff --git a/documentation/general/torn-sdk.md b/documentation/general/torn-sdk.md new file mode 100644 index 000000000000..e8de8b9f945d --- /dev/null +++ b/documentation/general/torn-sdk.md @@ -0,0 +1,182 @@ +# Torn .NET SDK + +## Terminology + +- **msbuild**: refers the .NET Framework based msbuild included with Visual Studio. +- **dotnet msbuild**: refers to the .NET Core based msbuild included with the .NET SDK. +- **analyzers**: this document will use analyzers to refer to both analyzers and generators. + +## Summary + +Visual Studio and .NET SDK are separate products but they are intertwined in command line and design time build scenarios as different components are loaded from each product. This table represents how the products currently function: + +| Scenario | Loads Roslyn | Loads Analyzers / Generators | +| --- | --- | --- | +| msbuild | From Visual Studio | From .NET SDK | +| dotnet msbuild | From .NET SDK | From .NET SDK | +| Visual Studio Design Time | From Visual Studio | From Both | + +Generally this mixing of components is fine because Visual Studio will install a .NET SDK that is functionally paired with it. That is the compiler and analyzers are the same hence mixing poses no real issue. For example 17.10 installs .NET SDK 8.0.3xx, 17.9 installs .NET SDK 8.0.2xx, etc ... However when the .NET SDK is not paired with the Visual Studio version,then compatibility issues can, and will, arise. Particularly when the .NET SDK is _newer_ than Visual Studio customers will end up with the following style of error: + +> CSC : warning CS9057: The analyzer assembly '..\dotnet\sdk\8.0.200\Sdks\Microsoft.NET.Sdk.Razor\source- +> generators\Microsoft.CodeAnalysis.Razor.Compiler.SourceGenerators.dll' references version '4.9.0.0' of the compiler, which is newer +> than the currently running version '4.8.0.0'. + +This torn state is a common customer setup: + +|Visual Studio Version | Match% | Float % | Torn % | +| --- | --- | --- | --- | +| 16.11 | 81.4% | 10.8% | 7.8% | +| 17.2 | 91% | 8% | 1% | +| 17.4 | 91.5% | 5.7% | 2.7% | +| 17.6 | 91.6% | 5% | 3.5% | +| 17.7 | 94.9% | 2.2% | 3% | +| 17.8 | 96% | 0% | 4% | + +To address this issue we are going to separate Visual Studio and the .NET SDK in build scenarios. That will change our matrix to _logically_ be the following: + +| Scenario | Loads Roslyn | Loads Analyzers / Generators | +| --- | --- | --- | +| msbuild | From .NET SDK | From .NET SDK | +| dotnet msbuild | From .NET SDK | From .NET SDK | +| Visual Studio Design Time | From Visual Studio | From Visual Studio | + +Specifically we will be + +1. Changing msbuild to use a compiler at least as new as the .NET SDKs compiler +2. Changing Visual Studio to use analyzers from Visual Studio + +In addition to making our builds more reliable this will also massively simplify our [analyzer Development strategy][sdk-lifecycle]. Analyzers in the SDK following this model can always target the latest Roslyn version without the need for complicated multi-targeting. + +## Motivations + +There are a number of scenarios where customers end up in a torn state. The most common is when customers have a CI setup with the following items: + +1. They use a task like [actions/setup-dotnet][setup-dotnet] to install the .NET SDK and use a flexible version format like `8.x`. +2. They use `msbuild` to actually drive their build. This `msbuild` comes from the Visual Studio installed on the machine image. + +This means that CI systems are updated to the latest .NET SDK virtually as soon as we release them. However the version of Visual Studio is updated much later as CI images usually take several weeks to upgrade to a new Visual Studio version. This is a very common CI setup and means a significant number of our customers end up in a torn state for several weeks. + +Another reason is that teams use older Visual Studio versions due to internal constraints: like an organizational policy. At the same time they install the latest .NET SDK which puts them into a torn state. + +This also hits any customer that uses a preview version of .NET SDK. These inherently represent a torn SDK state because they almost never match the compiler in Visual Studio. This results in blockers for big teams like Bing from testing out our previews. + +## Goals + +This design has a number of goals: + +1. The `msbuild` and `dotnet msbuild` build experience should be equivalent. +1. The Visual Studio Design time experience is independent of the .NET SDK installed. +1. To make explicit that it is okay, and even expected, that the design time and command line build experiences can differ when the SDK is in a torn state. + +## MSBuild using .NET SDK Compiler + +The .NET SDK will start producing a package named Microsoft.Net.Sdk.Compilers.Toolset. This will contain a .NET Framework version of the Roslyn compiler that matches .NET Core version. This will be published as a part of the .NET SDK release process meaning it's available for all publicly available .NET SDKs. + +The .NET SDK has the capability to [detect a torn state][pr-detect-torn-state]. When this is detected and msbuild's compiler is older, the matching Microsoft.Net.Sdk.Compilers.Toolset package for this version of the .NET SDK will be downloaded via ``. Then the `$(RoslynTargetsPath)` will be reset to point into the package contents. This will cause MSBuild to load the Roslyn compiler from that location vs. the Visual Studio location. + +One downside to this approach is that it is possible to end up with two VBCSCompiler server processes. Consider a solution that has a mix of .NET SDK style projects and non-SDK .NET projects. In a torn state the .NET SDK projects will use the .NET SDK compiler and non-SDK .NET projects will use the Visual Studio compiler. While not a desirable outcome, it is a correct one. Customers who wish to only have one VBCSCompiler should correct the torn state in their build tools. + +## Visual Studio using Visual Studio Analyzers + +Analyzers are required to function in all of our currently supported Visual Studio versions. This design proposal does not change this requirement. Instead it seeks to simplify the set of scenarios that analyzers need to consider by making compiler versions more predictable. It also helps establish a simple path for inbox analyzers to simply use the latest Roslyn in their development. + +### .NET SDK in box analyzers dual insert + +Analyzers which ship in the .NET SDK box will change to having a copy checked into Visual Studio. When .NET SDK based projects are loaded at design time, the Visual Studio copy of the analyzer will be loaded. Roslyn already understands how to prefer Visual Studio copies of analyzers. That work will need to be extended a bit but that is pretty straight forward code. + +This approach enables us to take actions like NGEN or R2R analyzers inside of Visual Studio. This is a long standing request from the Visual Studio perf team but very hard to satisfy in our current setup. + +This approach is already taken by [the Razor generator][code-razor-vs-load]. This work was done for other reliability reasons but turned out working well for this scenario. There is initial upfront work to get the Visual Studio copy loading in design time builds but it has virtually zero maintenance cost. + +This also means these analyzers can vastly simplify their development model by always targeting the latest version of Roslyn. There is no more need to multi-target because the version of the compiler the analyzer will be used with is known at ship time for all core build scenarios. + +This does mean that our design time experience can differ from our command line experience when customers are in a torn state. Specifically it's possible, even likely in some cases, that the diagnostics produced by design time builds will differ from command line builds. That is a trade off that we are willing to make for reliability. Customers who wish to have a consistent experience between design time should not operate in a torn state. + +## .NET SDK in box analyzers target oldest + +Analyzers which have no need to target the latest Roslyn could instead choose to target the oldest supported version of Roslyn. That ensures they can safely load into any supported scenario without issue. + +This strategy should be considered short term. The Roslyn API is under constant development to respond to the performance demands of Visual Studio. New APIs can quickly become virtually mandatory for analyzers and generators to use and will only be available on latest. At that point the analyzer will need to also update to use dual insertions. + +### NuGet based analyzers + +Analyzers which ship via NuGet will continue to following the existing [support policies][matrix-of-paine]. This means that they will either need to target a sufficiently old version of Roslyn or implement multi-targeting support. + +In the case of [multi-targeting][issue-analyzer-mt] this proposal is effectively a no-op. Analyzer multi-targeting is already based off of Roslyn versions, not .NET SDK versions, hence the proper version of the analyzer will still load in a torn state. The version of the Roslyn compiler in a torn state for msbuild is the same used for dotnet build hence it's already a scenario the analyzer needs to support. + +## Alternative + +### .NET SDK in box analyzers multi-target + +Technically in box analyzers can have a multi-targeting strategy just as NuGet based analyzers do. This is actively discouraged because it leads to unnecessary increases in .NET SDK sizes. The time spent implementing multi-targeting is likely better spent moving to a dual insertion to keep .NET SDK sizes down and provide a consistent experience with other analyzers. + +### .NET SDK in box analyzers use light up + +In box could also employ a light up strategy. Essentially reference older versions of the compiler and use reflection to opportunistically discover + use newer APIs. This is successfully employed in analyzers like StyleCop. + +### PackageReference + +Instead of `` the toolset package could be installed via ``. This is how the existing Microsoft.Net.Compilers.Toolset package works today. This has a number of disadvantages: + +1. `PackageReference` elements are not side effect free and have been shown to cause issues in complex builds. For example this package did not work by default in the Visual Studio or Bing builds. Deploying this at scale to all our customers will almost certainly cause issues. +1. This approach does not solve all scenarios. The mechanics of restore mean that the compiler is not swapped until part way through the build. Build operations that happen earlier, such as [legacy WPF][issue-legacy-wpf], will still use the Visual Studio compiler and hence experience analyzer compatibility issues. +1. Mixing builds that do and do not restore can lead to different build outcomes as they can end up choosing different compilers. Mixing the version of msbuild / dotnet msbuild can also lead to strange outcomes as they can end up choosing different compilers. +1. `PackageReference` elements, even when implicit, end up showing up in NuGet lock files. That makes it difficult for lock files to be kept in a consistent state as subtly changing the Visual Studio or .NET SDK version would end up impacting the lock file. + +### Install the Framework compiler + +An alternative is simply shipping both Roslyn compilers in the Windows .NET SDK. This means there is no need for a `` step as the compiler is always there. This is a simpler build but it means that all .NET SDK installs on Windows will increase by ~6-7%. + +This approach does have downsides: + +1. The Windows .NET SDK increased in size even when it's not needed. For example our main Windows containers do not install Visual Studio hence are never in a torn state yet they'll see increased size cost here. Changing the .NET SDK such that these extra compilers are only installed sometimes would add significant complexity to our installer setup. +2. This will make the Windows and Linux .NET SDK's visibly different in layout. Comparing them will show different contents which could be confusing to customers. At the same time the current proposal is functionally the same, it just changes where the framework compilers are placed on disk and that also could be confusing to customers. + +### Use the .NET Core compiler + +Instead of downloading a .NET Framework Roslyn in a torn state, the SDK could just use the .NET Core Roslyn it comes with. That would have virtually no real compatibility issues. This has a number of disadvantages: + +1. Changes the process name from VBCSCompiler to `dotnet`. That seems insignificant but the process name is important as it's referenced in a lot of build scripts. This would be a subtle breaking change that we'd have to work with customers on. +2. This would make Visual Studio dependent on the servicing lifetime of the .NET Core runtime in the SDK. That has a very different lifetime and could lead to surprising outcomes down the road. For example if policy removed out of support runtimes from machines it would break the Visual Studio build. + +## Misc + +### Visual Studio Code + +This is how Visual Studio Code fits into our matrix after this work is complete: + +| Scenario | Loads Roslyn | Loads Analyzers / Generators | +| --- | --- | --- | +| msbuild | From .NET SDK | From .NET SDK | +| dotnet msbuild | From .NET SDK | From .NET SDK | +| Visual Studio Design Time | From Visual Studio | From Visual Studio | +| DevKit | From DevKit | From .NET SDK | + +On the surface it seems like VS Code has the same issues as Visual Studio does today. However this is not the case. Visual Studio is problematic because at any given time there can be ~5 different versions in active support each with a different version of the compiler. Every Visual Studio but the latest is an older compiler that run into issues with analyzers. + +There is only one version of the DevKit extension. It is released using the latest compilers from roslyn at a very high frequency. That frequency is so high that the chance it has an older compiler than the newest .NET SDK is virtually zero. That means at the moment there is no need to solve the problem here. If DevKit changes its release cadance in the future this may need to be revisited. + +### Why not always use Micosoft.Net.Sdk.Compilers.Toolset? + +This design puts us in a state where `msbuild` will sometimes use the compiler from the .NET and sometimes use it from the MSBuild install. One may ask it why not simplify this and always load from the .NET SDK? Essentially why have all this complexity around torn state detection instead of just always using Microsoft.Net.Sdk.Compilers.Toolset? Or always use it when the compiler versions are different, not just when the .NET SDK is newer than Visual Studio. + +The main reason is performance. The compiler inside MSBuild is NGEN'd while the compiler inside Microosft.Net.Sdk.Compilers.Toolset is not. That means there is a small initial startup penalty when loading the compiler from the package. The VBCSCompiler server process largely amortizes that penalty though. Our expectation is that this difference will be largely unnoticeable to customers. + +The second reason is that this introduces a new `PackageDownload` step into the build. Doing that always carries some amount of risk. By scoping to only when the `msbuild` compiler is older we reduce the scope of this potential problem. + +We plan to revisit this decision in future releases of the .NET SDK as we get real world experience with this change and the customer feedback that comes from it. + +### Related Issues + +- [Roslyn tracking issue for torn state](https://github.com/dotnet/roslyn/issues/72672) +- [MSBuild property for torn state detection](https://github.com/dotnet/installer/pull/19144) +- [Long term build-server shutdown issue](https://github.com/dotnet/msbuild/issues/10035) + +[matrix-of-paine]: https://aka.ms/dotnet/matrixofpaine +[sdk-lifecycle]: https://learn.microsoft.com/en-us/dotnet/core/porting/versioning-sdk-msbuild-vs#lifecycle +[code-razor-vs-load]: https://github.com/dotnet/roslyn/blob/9aea80927e3d4e5a2846efaa710438c0d8d2bfa2/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProject.cs#L1009 +[setup-dotnet]: https://github.com/actions/setup-dotnet +[pr-detect-torn-state]: https://github.com/dotnet/installer/pull/19144 +[issue-analyzer-mt]: https://github.com/dotnet/sdk/issues/20355 +[issue-legacy-wpf]: https://github.com/dotnet/wpf/issues/9112 diff --git a/documentation/general/workloads/README.md b/documentation/general/workloads/README.md index c0b42f9a91a4..7824375544df 100644 --- a/documentation/general/workloads/README.md +++ b/documentation/general/workloads/README.md @@ -20,4 +20,5 @@ Other documentation for workloads is in this repo: - [Grouping multiple packs into one MSI](https://github.com/dotnet/sdk/issues/21741) - [Handling workload assets across major .NET versions](cross-version-workloads.md) - [Workload Clean Command](workload-clean.md) -- [Workload MSI Installation Tests](/src/Tests/dotnet-MsiInstallation.Tests/README.md) +- [Workload MSI Installation Tests](/test/dotnet-MsiInstallation.Tests/README.md) +- [Diagnosing workloads issues](workload-diagnosis.md) diff --git a/documentation/general/workloads/workload-diagnosis.md b/documentation/general/workloads/workload-diagnosis.md new file mode 100644 index 000000000000..49fb19d3bc9e --- /dev/null +++ b/documentation/general/workloads/workload-diagnosis.md @@ -0,0 +1,40 @@ +# Diagnosing issues with .NET SDK Workloads + +## Installing Workloads + +### Finding New Workloads to Install + +The .NET SDK is designed on workload install, update, and restore to look for the latest available workload of the matching feature band in your configured nuget feeds. + +First, we try to find a new version that matches your currently installed .NET SDK band (so if you have an 8.0.3xx SDK, we'll look for an 8.0.300 band workload). Then we'll look for a workload in the band matching what's currently installed. + +These new manifests get installed into the dotnet/sdk-manifests folder. +Next we will install the packs (nuget packages we install into the dotnet/packs folder) needed for the workloads you're trying to install as defined in the appropriate manifest. + +### Likely Install Failures + +When installing workloads, you may encounter the following common failures: + +1. Workload pack not found in the nuget feed. This means that a manifest you've installed cannot find a pack referenced from that manifest. Most likely you updated your workloads with one set of feeds and now have a new set of feeds configured. Either find the feed you need or use a rollback file to switch to an older version of the workloads. +_Workload installation failed: One or more errors occurred. (microsoft.netcore.app.runtime.mono.ios-arm.msi.x64::7.0.16 is not found in NuGet feeds ".)_ +2. Mismatched workload manifest versions. This is likely because your feed had a workload from runtime but not the matching workload from dotnet/emsdk. If you're not using any special feeds, that probably means it's release day and the emsdk workload is in the process of being released. We've been trying to improve this process with each release to avoid this issue. +_Installation rollback failed: Workload manifest dependency 'Microsoft.NET.Workload.Emscripten.Current' version '8.0.3' is lower than version '8.0.4' required by manifest 'microsoft.net.workload.mono.toolchain.current'_ + +## Diagnosing Issues With Installed Workloads + +### Common Workload State Failrues + +1. Workload is not installed. Try running `dotnet workload restore`. If that does not work, try running `dotnet build -getItem:MissingWorkloadPack` to determine what workload packs are missing. Our workload detection logic could be wrong and you could need a different workload than we list. This call should provide the pack we need and file an issue in the SDK repo with this information. +_NETSDK1147: To build this project, the following workloads must be installed:_ +2. You installed workloads previously but now your workload templates are missing (Aspire and MAUI templates are installed by the workloads). This could be because your workloads were installed correctly at some point in the past but are now out of sync. + 1. You installed a new band of the SDK. Workloads are installed per band so installing a new SDK could lead to your workloads not working. [Workload versions](https://github.com/dotnet/designs/pull/294)s should improve that. + 2. You installed a different workload from the dotnet CLI. We've improved this a few times but it's still possible to install a different workload which updates your workload manifests without updating your workloads. Please file a bug if this happens to you. + 3. You install a new version of Visual Studio that doesn't have worklaods selected. Visual Studio should include all available workloads so make sure to select them in Visual Studio setup. + +### Collecting Workload Information + +1. `dotnet workload --info` +2. `dotnet build -getItem:MissingWorkloadPack` +3. `dotnet --info` +4. `dotnet nuget list source` +5. https://aka.ms/vscollect <-- for admin install failures only diff --git a/documentation/manpages/sdk/dotnet-add-package.1 b/documentation/manpages/sdk/dotnet-add-package.1 index 56296ebb2602..3288c7261a49 100644 --- a/documentation/manpages/sdk/dotnet-add-package.1 +++ b/documentation/manpages/sdk/dotnet-add-package.1 @@ -14,7 +14,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "dotnet-add-package" "1" "2023-10-25" "" ".NET Documentation" +.TH "dotnet-add-package" "1" "2024-10-02" "" ".NET Documentation" .hy .SH dotnet add package .PP diff --git a/documentation/manpages/sdk/dotnet-add-reference.1 b/documentation/manpages/sdk/dotnet-add-reference.1 index abbd594ffd25..97255d5e114a 100644 --- a/documentation/manpages/sdk/dotnet-add-reference.1 +++ b/documentation/manpages/sdk/dotnet-add-reference.1 @@ -14,7 +14,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "dotnet-add-reference" "1" "2023-10-25" "" ".NET Documentation" +.TH "dotnet-add-reference" "1" "2024-10-02" "" ".NET Documentation" .hy .SH dotnet add reference .PP @@ -55,7 +55,7 @@ But you can do that by editing your \f[I].csproj\f[R] file and adding markup sim \f[C] - \[dq].\[rs]MyDLLFolder\[rs]MyAssembly.dll + .\[rs]MyDLLFolder\[rs]MyAssembly.dll \f[R] diff --git a/documentation/manpages/sdk/dotnet-build-server.1 b/documentation/manpages/sdk/dotnet-build-server.1 index 054dbb05a50f..ab1714b3cca2 100644 --- a/documentation/manpages/sdk/dotnet-build-server.1 +++ b/documentation/manpages/sdk/dotnet-build-server.1 @@ -14,7 +14,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "dotnet-build-server" "1" "2023-10-25" "" ".NET Documentation" +.TH "dotnet-build-server" "1" "2024-10-02" "" ".NET Documentation" .hy .SH dotnet build-server .PP diff --git a/documentation/manpages/sdk/dotnet-build.1 b/documentation/manpages/sdk/dotnet-build.1 index ec60b6207728..f6878f38c329 100644 --- a/documentation/manpages/sdk/dotnet-build.1 +++ b/documentation/manpages/sdk/dotnet-build.1 @@ -14,7 +14,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "dotnet-build" "1" "2023-10-25" "" ".NET Documentation" +.TH "dotnet-build" "1" "2024-10-02" "" ".NET Documentation" .hy .SH dotnet build .PP @@ -27,6 +27,7 @@ dotnet-build - Builds a project and all of its dependencies. .nf \f[C] dotnet build [|] [-a|--arch ] + [--artifacts-path ] [-c|--configuration ] [-f|--framework ] [--disable-build-servers] [--force] [--interactive] [--no-dependencies] [--no-incremental] @@ -35,7 +36,7 @@ dotnet build [|] [-a|--arch ] [-p|--property:=] [-r|--runtime ] [--self-contained [true|false]] [--source ] - [--tl [auto|on|off]] [--use-current-runtime, --ucr [true|false]] + [--tl:[auto|on|off]] [--use-current-runtime, --ucr [true|false]] [-v|--verbosity ] [--version-suffix ] dotnet build -h|--help @@ -132,6 +133,14 @@ If you use this option, don\[cq]t use the \f[V]-r|--runtime\f[R] option. Available since .NET 6 Preview 7. .RE .IP \[bu] 2 +\f[B]\f[VB]--artifacts-path \f[B]\f[R] +.RS 2 +.PP +All build output files from the executed command will go in subfolders under the specified path, separated by project. +For more information see Artifacts Output Layout. +Available since .NET 8 SDK. +.RE +.IP \[bu] 2 \f[B]\f[VB]-c|--configuration \f[B]\f[R] .RS 2 .PP @@ -273,7 +282,7 @@ Available since .NET 6. The URI of the NuGet package source to use during the restore operation. .RE .IP \[bu] 2 -\f[B]\f[VB]--tl [auto|on|off]\f[B]\f[R] +\f[B]\f[VB]--tl:[auto|on|off]\f[B]\f[R] .RS 2 .PP Specifies whether the \f[I]terminal logger\f[R] should be used for the build output. @@ -286,17 +295,17 @@ The terminal logger shows you the restore phase followed by the build phase. During each phase, the currently building projects appear at the bottom of the terminal. Each project that\[cq]s building outputs both the MSBuild target currently being built and the amount of time spent on that target. You can search this information to learn more about the build. -When a project is finished building, a single \[lq]build completed\[rq] section is written for that captures: +When a project is finished building, a single \[lq]build completed\[rq] section is written that captures: .IP \[bu] 2 -The name of the built project +The name of the built project. .IP \[bu] 2 -The target framework (if multi-targeted) +The target framework (if multi-targeted). .IP \[bu] 2 -The status of that build +The status of that build. .IP \[bu] 2 -The primary output of that build (which is hyperlinked) +The primary output of that build (which is hyperlinked). .IP \[bu] 2 -Any diagnostics generated for that project +Any diagnostics generated for that project. .PP This option is available starting in .NET 8. .RE @@ -349,12 +358,12 @@ dotnet build --configuration Release .fi .RE .IP \[bu] 2 -Build a project and its dependencies for a specific runtime (in this example, Ubuntu 18.04): +Build a project and its dependencies for a specific runtime (in this example, Linux): .RS 2 .IP .nf \f[C] -dotnet build --runtime ubuntu.18.04-x64 +dotnet build --runtime linux-x64 \f[R] .fi .RE diff --git a/documentation/manpages/sdk/dotnet-clean.1 b/documentation/manpages/sdk/dotnet-clean.1 index 9c24fa04623a..1d2f8f09a3c5 100644 --- a/documentation/manpages/sdk/dotnet-clean.1 +++ b/documentation/manpages/sdk/dotnet-clean.1 @@ -14,7 +14,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "dotnet-clean" "1" "2023-10-25" "" ".NET Documentation" +.TH "dotnet-clean" "1" "2024-10-02" "" ".NET Documentation" .hy .SH dotnet clean .PP @@ -26,10 +26,12 @@ dotnet-clean - Cleans the output of a project. .IP .nf \f[C] -dotnet clean [|] [-c|--configuration ] +dotnet clean [|] [--artifacts-path ] + [-c|--configuration ] [-f|--framework ] [--interactive] [--nologo] [-o|--output ] - [-r|--runtime ] [-v|--verbosity ] + [-r|--runtime ] [--tl:[auto|on|off]] + [-v|--verbosity ] dotnet clean -h|--help \f[R] @@ -48,6 +50,14 @@ The MSBuild project or solution to clean. If a project or solution file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in \f[I]proj\f[R] or \f[I]sln\f[R], and uses that file. .SH OPTIONS .IP \[bu] 2 +\f[B]\f[VB]--artifacts-path \f[B]\f[R] +.RS 2 +.PP +All build output files from the executed command will go in subfolders under the specified path, separated by project. +For more information see Artifacts Output Layout. +Available since .NET 8 SDK. +.RE +.IP \[bu] 2 \f[B]\f[VB]-c|--configuration \f[B]\f[R] .RS 2 .PP @@ -106,6 +116,34 @@ Cleans the output folder of the specified runtime. This is used when a self-contained deployment was created. .RE .IP \[bu] 2 +\f[B]\f[VB]--tl:[auto|on|off]\f[B]\f[R] +.RS 2 +.PP +Specifies whether the \f[I]terminal logger\f[R] should be used for the build output. +The default is \f[V]auto\f[R], which first verifies the environment before enabling terminal logging. +The environment check verifies that the terminal is capable of using modern output features and isn\[cq]t using a redirected standard output before enabling the new logger. +\f[V]on\f[R] skips the environment check and enables terminal logging. +\f[V]off\f[R] skips the environment check and uses the default console logger. +.PP +The terminal logger shows you the restore phase followed by the build phase. +During each phase, the currently building projects appear at the bottom of the terminal. +Each project that\[cq]s building outputs both the MSBuild target currently being built and the amount of time spent on that target. +You can search this information to learn more about the build. +When a project is finished building, a single \[lq]build completed\[rq] section is written that captures: +.IP \[bu] 2 +The name of the built project. +.IP \[bu] 2 +The target framework (if multi-targeted). +.IP \[bu] 2 +The status of that build. +.IP \[bu] 2 +The primary output of that build (which is hyperlinked). +.IP \[bu] 2 +Any diagnostics generated for that project. +.PP +This option is available starting in .NET 8. +.RE +.IP \[bu] 2 \f[B]\f[VB]-v|--verbosity \f[B]\f[R] .RS 2 .PP diff --git a/documentation/manpages/sdk/dotnet-dev-certs.1 b/documentation/manpages/sdk/dotnet-dev-certs.1 index 1c2b92e4aa96..d061cc94cdf6 100644 --- a/documentation/manpages/sdk/dotnet-dev-certs.1 +++ b/documentation/manpages/sdk/dotnet-dev-certs.1 @@ -15,7 +15,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "dotnet-dev-certs" "1" "2023-10-25" "" ".NET Documentation" +.TH "dotnet-dev-certs" "1" "2024-10-02" "" ".NET Documentation" .hy .SH dotnet dev-certs .PP diff --git a/documentation/manpages/sdk/dotnet-environment-variables.7 b/documentation/manpages/sdk/dotnet-environment-variables.7 index b5ce82b8886e..cf9140fe4d57 100644 --- a/documentation/manpages/sdk/dotnet-environment-variables.7 +++ b/documentation/manpages/sdk/dotnet-environment-variables.7 @@ -14,7 +14,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "dotnet-environment-variables" "7" "2023-10-25" "" ".NET Documentation" +.TH "dotnet-environment-variables" "7" "2024-10-02" "" ".NET Documentation" .hy .SH NAME .PP @@ -240,8 +240,20 @@ Defaults to 0. See the Diagnostic Port documentation for more information. .SS \f[V]DOTNET_EnableDiagnostics\f[R] .PP -When set to \f[V]1\f[R], enables debugging, profiling, and other diagnostics via the Diagnostic Port. -Defaults to 1. +When set to \f[V]0\f[R], disables debugging, profiling, and other diagnostics via the Diagnostic Port and can\[cq]t be overridden by other diagnostics settings. +Defaults to \f[V]1\f[R]. +.SS \f[V]DOTNET_EnableDiagnostics_IPC\f[R] +.PP +Starting with .NET 8, when set to \f[V]0\f[R], disables the Diagnostic Port and can\[cq]t be overridden by other diagnostics settings. +Defaults to \f[V]1\f[R]. +.SS \f[V]DOTNET_EnableDiagnostics_Debugger\f[R] +.PP +Starting with .NET 8, when set to \f[V]0\f[R], disables debugging and can\[cq]t be overridden by other diagnostics settings. +Defaults to \f[V]1\f[R]. +.SS \f[V]DOTNET_EnableDiagnostics_Profiler\f[R] +.PP +Starting with .NET 8, when set to \f[V]0\f[R], disables profiling and can\[cq]t be overridden by other diagnostics settings. +Defaults to \f[V]1\f[R]. .SS EventPipe variables .PP See EventPipe environment variables for more information. @@ -253,11 +265,12 @@ See EventPipe environment variables for more information. \f[V]DOTNET_EventPipeOutputStreaming\f[R]: When set to \f[V]1\f[R], enables streaming to the output file while the app is running. By default trace information is accumulated in a circular buffer and the contents are written at app shutdown. .SS .NET SDK and CLI environment variables -.SS \f[V]DOTNET_ROOT\f[R], \f[V]DOTNET_ROOT(x86)\f[R] +.SS \f[V]DOTNET_ROOT\f[R], \f[V]DOTNET_ROOT(x86)\f[R], \f[V]DOTNET_ROOT_X86\f[R], \f[V]DOTNET_ROOT_X64\f[R] .PP Specifies the location of the .NET runtimes, if they are not installed in the default location. The default location on Windows is \f[V]C:\[rs]Program Files\[rs]dotnet\f[R]. The default location on macOS is \f[V]/usr/local/share/dotnet\f[R]. +The default location for the x64 runtimes on an arm64 OS is under an x64 subfolder (so \f[V]C:\[rs]Program Files\[rs]dotnet\[rs]x64\f[R] on windows and \f[V]/usr/local/share/dotnet/x64\f[R] on macOS. The default location on Linux varies depending on distro and installment method. The default location on Ubuntu 22.04 is \f[V]/usr/share/dotnet\f[R] (when installed from \f[V]packages.microsoft.com\f[R]) or \f[V]/usr/lib/dotnet\f[R] (when installed from Jammy feed). For more information, see the following resources: @@ -270,6 +283,7 @@ GitHub issue dotnet/runtime#79237 (https://github.com/dotnet/runtime/issues/7923 .PP This environment variable is used only when running apps via generated executables (apphosts). \f[V]DOTNET_ROOT(x86)\f[R] is used instead when running a 32-bit executable on a 64-bit OS. +\f[V]DOTNET_ROOT_X64\f[R] is used instead when running a 64-bit executable on an ARM64 OS. .SS \f[V]DOTNET_HOST_PATH\f[R] .PP Specifies the absolute path to a \f[V]dotnet\f[R] host (\f[V]dotnet.exe\f[R] on Windows, \f[V]dotnet\f[R] on Linux and macOS) that was used to launch the currently-running \f[V]dotnet\f[R] process. @@ -286,6 +300,83 @@ otherwise, rely on \f[V]dotnet\f[R] via the system\[cq]s \f[V]PATH\f[R] \f[V]DOTNET_HOST_PATH\f[R] is not a general solution for locating the \f[V]dotnet\f[R] host. It is only intended to be used by tools that are invoked by the .NET SDK. .RE +.SS \f[V]DOTNET_LAUNCH_PROFILE\f[R] +.PP +The dotnet run command sets this variable to the selected launch profile. +.PP +Given the following \f[I]launchSettings.json\f[R] file: +.IP +.nf +\f[C] +{ + \[dq]profiles\[dq]: { + \[dq]First\[dq]: { + \[dq]commandName\[dq]: \[dq]Project\[dq], + }, + \[dq]Second\[dq]: { + \[dq]commandName\[dq]: \[dq]Project\[dq], + } + } +} +\f[R] +.fi +.PP +And the following \f[I]Program.cs\f[R] file: +.IP +.nf +\f[C] +var value = Environment.GetEnvironmentVariable(\[dq]DOTNET_LAUNCH_PROFILE\[dq]); +Console.WriteLine($\[dq]DOTNET_LAUNCH_PROFILE={value}\[dq]); +\f[R] +.fi +.PP +The following scenarios produce the output shown: +.IP \[bu] 2 +Launch profile specified and exists +.RS 2 +.IP +.nf +\f[C] +$ dotnet run --launch-profile First +DOTNET_LAUNCH_PROFILE=First +\f[R] +.fi +.RE +.IP \[bu] 2 +Launch profile not specified, first one selected +.RS 2 +.IP +.nf +\f[C] +$ dotnet run +DOTNET_LAUNCH_PROFILE=First +\f[R] +.fi +.RE +.IP \[bu] 2 +Launch profile specified but does not exist +.RS 2 +.IP +.nf +\f[C] +$ dotnet run --launch-profile Third +The launch profile \[dq]Third\[dq] could not be applied. +A launch profile with the name \[aq]Third\[aq] doesn\[aq]t exist. +DOTNET_LAUNCH_PROFILE= +\f[R] +.fi +.RE +.IP \[bu] 2 +Launch with no profile +.RS 2 +.IP +.nf +\f[C] +$ dotnet run --no-launch-profile +DOTNET_LAUNCH_PROFILE= +\f[R] +.fi +.RE .SS \f[V]NUGET_PACKAGES\f[R] .PP The global packages folder. @@ -317,11 +408,16 @@ To not add global tools to the path, set to \f[V]0\f[R], \f[V]false\f[R], or \f[ .PP Specifies whether data about the .NET tools usage is collected and sent to Microsoft. Set to \f[V]true\f[R] to opt-out of the telemetry feature (values \f[V]true\f[R], \f[V]1\f[R], or \f[V]yes\f[R] accepted). -Otherwise, set to \f[V]false\f[R] to opt into the telemetry features (values \f[V]false\f[R], \f[V]0\f[R], or \f[V]no\f[R] accepted). +Otherwise, set to \f[V]false\f[R] to opt in to the telemetry features (values \f[V]false\f[R], \f[V]0\f[R], or \f[V]no\f[R] accepted). If not set, the default is \f[V]false\f[R] and the telemetry feature is active. .SS \f[V]DOTNET_SKIP_FIRST_TIME_EXPERIENCE\f[R] .PP If \f[V]DOTNET_SKIP_FIRST_TIME_EXPERIENCE\f[R] is set to \f[V]true\f[R], the \f[V]NuGetFallbackFolder\f[R] won\[cq]t be expanded to disk and a shorter welcome message and telemetry notice will be shown. +.RS +.PP +This environment variable is no longer supported in .NET Core 3.0 and later. +Use \f[V]DOTNET_NOLOGO\f[R] as a replacement. +.RE .SS \f[V]DOTNET_MULTILEVEL_LOOKUP\f[R] .PP Specifies whether the .NET runtime, shared framework, or SDK are resolved from the global location. @@ -382,6 +478,16 @@ List of assemblies to load and execute startup hooks from. Specifies a directory to which a single-file application is extracted before it is executed. .PP For more information, see Single-file executables. +.SS \f[V]DOTNET_CLI_HOME\f[R] +.PP +Specifies the location that supporting files for .NET CLI commands should be written to. +For example: +.IP \[bu] 2 +User-writable paths for workload packs, manifests, and other supporting data. +.IP \[bu] 2 +First-run sentinel/lock files for aspects of the .NET CLI\[cq]s first-run migrations and notification experiences. +.IP \[bu] 2 +The default .NET local tool installation location. .SS \f[V]DOTNET_CLI_CONTEXT_*\f[R] .IP \[bu] 2 \f[V]DOTNET_CLI_CONTEXT_VERBOSE\f[R]: To enable a verbose context, set to \f[V]true\f[R]. diff --git a/documentation/manpages/sdk/dotnet-format.1 b/documentation/manpages/sdk/dotnet-format.1 index cb28edeca4f8..de2870a41082 100644 --- a/documentation/manpages/sdk/dotnet-format.1 +++ b/documentation/manpages/sdk/dotnet-format.1 @@ -14,7 +14,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "dotnet-format" "1" "2023-10-25" "" ".NET Documentation" +.TH "dotnet-format" "1" "2024-10-02" "" ".NET Documentation" .hy .SH dotnet format .PP @@ -26,14 +26,14 @@ dotnet-format - Formats code to match \f[V]editorconfig\f[R] settings. .IP .nf \f[C] -dotnet format [options] [] +dotnet format [] [command] [options] dotnet format -h|--help \f[R] .fi .SH DESCRIPTION .PP -\f[V]dotnet format\f[R] is a code formatter that applies style preferences to a project or solution. +\f[V]dotnet format\f[R] is a code formatter that applies style preferences and static analysis recommendations to a project or solution. Preferences will be read from an \f[I].editorconfig\f[R] file, if present, otherwise a default set of preferences will be used. For more information, see the EditorConfig documentation. .SH ARGUMENTS @@ -127,7 +127,7 @@ Shows help and usage information \f[V]dotnet format whitespace\f[R] - Formats code to match \f[V]editorconfig\f[R] settings for whitespace. .SH DESCRIPTION .PP -The \f[V]dotnet format whitespace\f[R] subcommand will only run formatting rules associated with whitespace formatting. +The \f[V]dotnet format whitespace\f[R] subcommand only runs formatting rules associated with whitespace formatting. For a complete list of possible formatting options that you can specify in your \f[I].editorconfig\f[R] file, see the C# formatting options. .SH OPTIONS .IP \[bu] 2 @@ -141,16 +141,16 @@ Treat the \f[V]\f[R] argument as a path to a simple folder o \f[V]dotnet format style\f[R] - Formats code to match EditorConfig settings for code style. .SH DESCRIPTION .PP -The \f[V]dotnet format style\f[R] subcommand will only run formatting rule associated with code style formatting. +The \f[V]dotnet format style\f[R] subcommand only runs formatting rules associated with code style formatting. For a complete list of formatting options that you can specify in your \f[V]editorconfig\f[R] file, see Code style rules. .SH OPTIONS .IP \[bu] 2 \f[B]\f[VB]--diagnostics \f[B]\f[R] .RS 2 .PP -A space-separated list of diagnostic IDs to use as a filter when fixing code style or third-party issues. +A space-separated list of diagnostic IDs to use as a filter when fixing code style issues. Default value is whichever IDs are listed in the \f[I].editorconfig\f[R] file. -For a list of built-in analyzer rule IDs that you can specify, see the list of IDs for code-analysis style rules. +For a list of built-in code style analyzer rule IDs that you can specify, see the list of IDs for code-analysis style rules. .RE .IP \[bu] 2 \f[B]\f[VB]--severity\f[B]\f[R] @@ -162,19 +162,20 @@ The default value is \f[V]warn\f[R] .RE .SS Analyzers .PP -\f[V]dotnet format analyzers\f[R] - Formats code to match \f[V]editorconfig\f[R] settings for analyzers. +\f[V]dotnet format analyzers\f[R] - Formats code to match \f[V]editorconfig\f[R] settings for analyzers (excluding code style rules). .SH DESCRIPTION .PP -The \f[V]dotnet format analyzers\f[R] subcommand will only run formatting rule associated with analyzers. -For a list of analyzer rules that you can specify in your \f[V]editorconfig\f[R] file, see Code style rules. +The \f[V]dotnet format analyzers\f[R] subcommand only runs formatting rules associated with analyzers. +For a list of analyzer rules that you can specify in your \f[V]editorconfig\f[R] file, see Quality rules. .SH OPTIONS .IP \[bu] 2 \f[B]\f[VB]--diagnostics \f[B]\f[R] .RS 2 .PP -A space-separated list of diagnostic IDs to use as a filter when fixing code style or third-party issues. +A space-separated list of diagnostic IDs to use as a filter when fixing non code style issues. Default value is whichever IDs are listed in the \f[I].editorconfig\f[R] file. -For a list of built-in analyzer rule IDs that you can specify, see the list of IDs for code-analysis style rules. +For a list of built-in analyzer rule IDs that you can specify, see the list of IDs for quality rules. +For third-party analyzers refer to their documentation. .RE .IP \[bu] 2 \f[B]\f[VB]--severity\f[B]\f[R] @@ -225,3 +226,43 @@ dotnet format --include ./src/ ./tests/ --exclude ./src/submodule-a/ \f[R] .fi .RE +.IP \[bu] 2 +Fix a specific \f[B]code style\f[R] issue: +.RS 2 +.IP +.nf +\f[C] +dotnet format style --diagnostics IDE0005 --severity info +\f[R] +.fi +.RE +.IP \[bu] 2 +Fix all \f[B]code style\f[R] issues that have severity \f[V]info\f[R], \f[V]warning\f[R] or \f[V]error\f[R]: +.RS 2 +.IP +.nf +\f[C] +dotnet format style --severity info +\f[R] +.fi +.RE +.IP \[bu] 2 +Fix a specific (non code style) analyzer issue: +.RS 2 +.IP +.nf +\f[C] +dotnet format analyzers --diagnostics CA1831 --severity warn +\f[R] +.fi +.RE +.IP \[bu] 2 +Fix all non code style issues that have severity \f[V]info\f[R], \f[V]warning\f[R] or \f[V]error\f[R]: +.RS 2 +.IP +.nf +\f[C] +dotnet format analyzers --severity info +\f[R] +.fi +.RE diff --git a/documentation/manpages/sdk/dotnet-help.1 b/documentation/manpages/sdk/dotnet-help.1 index 0bd7df09968d..dda34df0732e 100644 --- a/documentation/manpages/sdk/dotnet-help.1 +++ b/documentation/manpages/sdk/dotnet-help.1 @@ -14,7 +14,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "dotnet-help" "1" "2023-10-25" "" ".NET Documentation" +.TH "dotnet-help" "1" "2024-10-02" "" ".NET Documentation" .hy .SH dotnet help reference .PP diff --git a/documentation/manpages/sdk/dotnet-list-package.1 b/documentation/manpages/sdk/dotnet-list-package.1 index 2e3e95e5c22b..875df968de55 100644 --- a/documentation/manpages/sdk/dotnet-list-package.1 +++ b/documentation/manpages/sdk/dotnet-list-package.1 @@ -14,7 +14,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "dotnet-list-package" "1" "2023-10-25" "" ".NET Documentation" +.TH "dotnet-list-package" "1" "2024-10-02" "" ".NET Documentation" .hy .SH dotnet list package .PP @@ -28,7 +28,7 @@ dotnet-list-package - Lists the package references for a project or solution. \f[C] dotnet list [|] package [--config ] [--deprecated] - [--framework ] [--highest-minor] [--highest-patch] + [-f|--framework ] [--highest-minor] [--highest-patch] [--include-prerelease] [--include-transitive] [--interactive] [--outdated] [--source ] [-v|--verbosity ] [--vulnerable] @@ -114,12 +114,13 @@ Requires the \f[V]--outdated\f[R] option. Displays packages that have been deprecated. .RE .IP \[bu] 2 -\f[B]\f[VB]--framework \f[B]\f[R] +\f[B]\f[VB]-f|--framework \f[B]\f[R] .RS 2 .PP Displays only the packages applicable for the specified target framework. To specify multiple frameworks, repeat the option multiple times. For example: \f[V]--framework net6.0 --framework netstandard2.0\f[R]. +The short form of the option (\f[V]-f\f[R]) is available starting in .NET 9 SDK. .RE .IP \[bu] 2 \f[B]\f[VB]-?|-h|--help\f[B]\f[R] diff --git a/documentation/manpages/sdk/dotnet-list-reference.1 b/documentation/manpages/sdk/dotnet-list-reference.1 index 800d8ca3927a..9730e8990125 100644 --- a/documentation/manpages/sdk/dotnet-list-reference.1 +++ b/documentation/manpages/sdk/dotnet-list-reference.1 @@ -14,7 +14,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "dotnet-list-reference" "1" "2023-10-25" "" ".NET Documentation" +.TH "dotnet-list-reference" "1" "2024-10-02" "" ".NET Documentation" .hy .SH dotnet list reference .PP diff --git a/documentation/manpages/sdk/dotnet-migrate.1 b/documentation/manpages/sdk/dotnet-migrate.1 index 71f8a11c471b..488833f8c5e6 100644 --- a/documentation/manpages/sdk/dotnet-migrate.1 +++ b/documentation/manpages/sdk/dotnet-migrate.1 @@ -14,7 +14,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "dotnet-migrate" "1" "2023-10-25" "" ".NET Documentation" +.TH "dotnet-migrate" "1" "2024-10-02" "" ".NET Documentation" .hy .SH dotnet migrate .PP diff --git a/documentation/manpages/sdk/dotnet-msbuild.1 b/documentation/manpages/sdk/dotnet-msbuild.1 index 3a152a3ac02e..3961ccf06801 100644 --- a/documentation/manpages/sdk/dotnet-msbuild.1 +++ b/documentation/manpages/sdk/dotnet-msbuild.1 @@ -14,7 +14,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "dotnet-msbuild" "1" "2023-10-25" "" ".NET Documentation" +.TH "dotnet-msbuild" "1" "2024-10-02" "" ".NET Documentation" .hy .SH dotnet msbuild .PP @@ -64,12 +64,12 @@ dotnet msbuild -property:Configuration=Release .fi .RE .IP \[bu] 2 -Run the publish target and publish for the \f[V]osx.10.11-x64\f[R] RID: +Run the publish target and publish for the \f[V]osx-x64\f[R] RID: .RS 2 .IP .nf \f[C] -dotnet msbuild -target:Publish -property:RuntimeIdentifiers=osx.10.11-x64 +dotnet msbuild -target:Publish -property:RuntimeIdentifiers=osx-x64 \f[R] .fi .RE diff --git a/documentation/manpages/sdk/dotnet-new-details.1 b/documentation/manpages/sdk/dotnet-new-details.1 index 6f1b7be169f3..4d26bc738627 100644 --- a/documentation/manpages/sdk/dotnet-new-details.1 +++ b/documentation/manpages/sdk/dotnet-new-details.1 @@ -14,11 +14,11 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "dotnet-new-details" "1" "2023-10-25" "" ".NET Documentation" +.TH "dotnet-new-details" "1" "2024-10-02" "" ".NET Documentation" .hy .SH dotnet new details .PP -\f[B]This article applies to:\f[R] \[u2714]\[uFE0F] .NET 8 preview 6 +\f[B]This article applies to:\f[R] \[u2714]\[uFE0F] .NET 8 .SH NAME .PP dotnet-new-details - Displays template package metadata. diff --git a/documentation/manpages/sdk/dotnet-new-install.1 b/documentation/manpages/sdk/dotnet-new-install.1 index e62824844716..07172f5ced35 100644 --- a/documentation/manpages/sdk/dotnet-new-install.1 +++ b/documentation/manpages/sdk/dotnet-new-install.1 @@ -14,7 +14,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "dotnet-new-install" "1" "2023-10-25" "" ".NET Documentation" +.TH "dotnet-new-install" "1" "2024-10-02" "" ".NET Documentation" .hy .SH dotnet new install .PP diff --git a/documentation/manpages/sdk/dotnet-new-list.1 b/documentation/manpages/sdk/dotnet-new-list.1 index f0948edf29c6..0fdd0d18d463 100644 --- a/documentation/manpages/sdk/dotnet-new-list.1 +++ b/documentation/manpages/sdk/dotnet-new-list.1 @@ -14,7 +14,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "dotnet-new-list" "1" "2023-10-25" "" ".NET Documentation" +.TH "dotnet-new-list" "1" "2024-10-02" "" ".NET Documentation" .hy .SH dotnet new list .PP diff --git a/documentation/manpages/sdk/dotnet-new-sdk-templates.7 b/documentation/manpages/sdk/dotnet-new-sdk-templates.7 index 9fd5e19e0fdb..19fad24c72c3 100644 --- a/documentation/manpages/sdk/dotnet-new-sdk-templates.7 +++ b/documentation/manpages/sdk/dotnet-new-sdk-templates.7 @@ -15,7 +15,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "dotnet-new-sdk-templates" "7" "2023-10-25" "" ".NET Documentation" +.TH "dotnet-new-sdk-templates" "7" "2024-10-02" "" ".NET Documentation" .hy .SH NAME .PP @@ -238,50 +238,28 @@ T}@T{ 2.0 T} T{ -Blazor Server App +Blazor Web App T}@T{ -\f[V]blazorserver\f[R] +\f[V]blazor\f[R] T}@T{ [C#] T}@T{ Web/Blazor T}@T{ -3.0 +8.0.100 T} T{ -Blazor Server App Empty -T}@T{ -\f[V]blazorserver-empty\f[R] -T}@T{ -[C#] -T}@T{ -Web/Blazor -T}@T{ -7.0 -T} -T{ -Blazor WebAssembly App +Blazor WebAssembly Standalone App T}@T{ \f[V]blazorwasm\f[R] T}@T{ [C#] T}@T{ -Web/Blazor/WebAssembly +Web/Blazor/WebAssembly/PWA T}@T{ 3.1.300 T} T{ -Blazor WebAssembly App Empty -T}@T{ -\f[V]blazorwasm-empty\f[R] -T}@T{ -[C#] -T}@T{ -Web/Blazor/WebAssembly -T}@T{ -7.0 -T} -T{ ASP.NET Core Empty T}@T{ \f[V]web\f[R] @@ -315,28 +293,6 @@ T}@T{ 2.2, 2.0 T} T{ -ASP.NET Core with Angular -T}@T{ -\f[V]angular\f[R] -T}@T{ -[C#] -T}@T{ -Web/MVC/SPA -T}@T{ -2.0 -T} -T{ -ASP.NET Core with React.js -T}@T{ -\f[V]react\f[R] -T}@T{ -[C#] -T}@T{ -Web/MVC/SPA -T}@T{ -2.0 -T} -T{ Razor Class Library T}@T{ \f[V]razorclasslib\f[R] @@ -370,6 +326,17 @@ T}@T{ 8.0 T} T{ +ASP.NET Core API controller +T}@T{ +\f[V]apicontroller\f[R] +T}@T{ +[C#] +T}@T{ +Web/ASP.NET +T}@T{ +8.0 +T} +T{ ASP.NET Core gRPC Service T}@T{ \f[V]grpc\f[R] @@ -453,7 +420,7 @@ T} T{ EditorConfig file T}@T{ -\f[V]editorconfig\f[R](#editorconfig) +\f[V]editorconfig\f[R] T}@T{ T}@T{ Config @@ -461,6 +428,81 @@ T}@T{ 6.0 T} .TE +.PP +The following table shows templates that have been discontinued and no longer come pre-installed with the .NET SDK. +Click on the short name link to see the specific template options. +.PP +.TS +tab(@); +l l l l l. +T{ +Templates +T}@T{ +Short name +T}@T{ +Language +T}@T{ +Tags +T}@T{ +Discontinued since +T} +_ +T{ +ASP.NET Core with Angular +T}@T{ +\f[V]angular\f[R] +T}@T{ +[C#] +T}@T{ +Web/MVC/SPA +T}@T{ +8.0 +T} +T{ +ASP.NET Core with React.js +T}@T{ +\f[V]react\f[R] +T}@T{ +[C#] +T}@T{ +Web/MVC/SPA +T}@T{ +8.0 +T} +T{ +Blazor Server App +T}@T{ +\f[V]blazorserver\f[R] +T}@T{ +[C#] +T}@T{ +Web/Blazor +T}@T{ +8.0 +T} +T{ +Blazor Server App Empty +T}@T{ +\f[V]blazorserver-empty\f[R] +T}@T{ +[C#] +T}@T{ +Web/Blazor +T}@T{ +8.0 +T} +T{ +Blazor WebAssembly App Empty +T}@T{ +\f[V]blazorwasm-empty\f[R] +T}@T{ +[C#] +T}@T{ +Web/Blazor/WebAssembly +T}@T{ +8.0 +T} +.TE .SS Template options .PP Each template may have additional options available. @@ -488,6 +530,11 @@ Default value T} _ T{ +8.0 +T}@T{ +\f[V]net8.0\f[R] +T} +T{ 7.0 T}@T{ \f[V]net7.0\f[R] @@ -549,8 +596,8 @@ Available only for C#. .RS 2 .PP Specifies the framework to target. -Values: \f[V]net7.0\f[R], \f[V]net6.0\f[R], or \f[V]netcoreapp3.1\f[R] to create a .NET Class Library or \f[V]netstandard2.1\f[R] or \f[V]netstandard2.0\f[R] to create a .NET Standard Class Library. -The default value for .NET SDK 7.0.x is \f[V]net7.0\f[R]. +Values: \f[V]net8.0\f[R], \f[V]net7.0\f[R], or \f[V]net6.0\f[R] to create a .NET Class Library, or \f[V]netstandard2.1\f[R] or \f[V]netstandard2.0\f[R] to create a .NET Standard Class Library. +The default value for .NET SDK 8.0.x is \f[V]net8.0\f[R]. .PP To create a project that targets a framework earlier than the SDK that you\[cq]re using, see \f[V]--framework\f[R] for \f[V]console\f[R] projects earlier in this article. .RE @@ -579,7 +626,7 @@ Doesn\[cq]t execute an implicit restore during project creation. .RS 2 .PP Specifies the framework to target. -For the .NET 6 SDK, the default value is \f[V]net6.0\f[R]. +For the .NET 8 SDK, the default value is \f[V]net8.0\f[R]. Available since .NET Core 3.1 SDK. .RE .IP \[bu] 2 @@ -623,7 +670,7 @@ Doesn\[cq]t execute an implicit restore during project creation. .RS 2 .PP Specifies the framework to target. -The default value for .NET 7 SDK is \f[V]net7.0\f[R]. +The default value for .NET 8 SDK is \f[V]net8.0\f[R]. Available since .NET Core 3.1 SDK. .PP To create a project that targets a framework earlier than the SDK that you\[cq]re using, see \f[V]--framework\f[R] for \f[V]console\f[R] projects earlier in this article. @@ -670,6 +717,16 @@ Default value T} _ T{ +8.0 +T}@T{ +\f[V]net8.0\f[R] +T} +T{ +7.0 +T}@T{ +\f[V]net7.0\f[R] +T} +T{ 6.0 T}@T{ \f[V]net6.0\f[R] @@ -725,6 +782,16 @@ Default value T} _ T{ +8.0 +T}@T{ +\f[V]net8.0\f[R] +T} +T{ +7.0 +T}@T{ +\f[V]net7.0\f[R] +T} +T{ 6.0 T}@T{ \f[V]net6.0\f[R] @@ -788,6 +855,8 @@ The default value is \f[V]MyApp.Namespace\f[R]. .PP * * * * * .SS \f[V]blazorserver\f[R] +.PP +\f[B]Discontinued since .NET 8 SDK.\f[R] .IP \[bu] 2 \f[B]\f[VB]-au|--auth \f[B]\f[R] .RS 2 @@ -802,6 +871,7 @@ The possible values are: \f[V]IndividualB2C\f[R] - Individual authentication with Azure AD B2C. .IP \[bu] 2 \f[V]SingleOrg\f[R] - Organizational authentication for a single tenant. +Entra External ID tenants also use \f[V]SingleOrg\f[R]. .IP \[bu] 2 \f[V]MultiOrg\f[R] - Organizational authentication for multiple tenants. .IP \[bu] 2 @@ -930,6 +1000,89 @@ If specified, an explicit \f[V]Program\f[R] class and \f[V]Main\f[R] method will Available since .NET SDK 6.0.300. Default value: \f[V]false\f[R]. .RE +.PP + * * * * * +.SS \f[V]blazor\f[R] +.IP \[bu] 2 +\f[B]\f[VB]-f|--framework \f[B]\f[R] +.RS 2 +.PP +Specifies the framework to target. +.PP +This template is available for .NET 8 or later. +.RE +.IP \[bu] 2 +\f[B]\f[VB]--no-restore\f[B]\f[R] +.RS 2 +.PP +Doesn\[cq]t execute an implicit restore during project creation. +.RE +.IP \[bu] 2 +\f[B]\f[VB]--exclude-launch-settings\f[B]\f[R] +.RS 2 +.PP +Excludes \f[I]launchSettings.json\f[R] from the generated app. +.RE +.IP \[bu] 2 +\f[B]\f[VB]-int|--interactivity \f[B]\f[R] +.RS 2 +.PP +Specifies which interactive render mode to use for interactive components. +The possible values are: +.IP \[bu] 2 +\f[V]None\f[R] - No interactivity (static server-side rendering only). +.IP \[bu] 2 +\f[V]Server\f[R] - (Default) Runs the app on the server with interactive server-side rendering. +.IP \[bu] 2 +\f[V]WebAssembly\f[R] - Runs the app using client-side rendering in the browser with WebAssembly. +.IP \[bu] 2 +\f[V]Auto\f[R] - Uses interactive server-side rendering while downloading the Blazor bundle and activating the Blazor runtime on the client, then uses client-side rendering with WebAssembly. +.RE +.IP \[bu] 2 +\f[B]\f[VB]--empty\f[B]\f[R] +.RS 2 +.PP +Omits sample pages and styling that demonstrate basic usage patterns. +.RE +.IP \[bu] 2 +\f[B]\f[VB]-au|--auth \f[B]\f[R] +.RS 2 +.PP +The type of authentication to use. +The possible values are: +.IP \[bu] 2 +\f[V]None\f[R] - No authentication (Default). +.IP \[bu] 2 +\f[V]Individual\f[R] - Individual authentication. +.RE +.IP \[bu] 2 +\f[B]\f[VB]-uld|--use-local-db\f[B]\f[R] +.RS 2 +.PP +Specifies LocalDB should be used instead of SQLite. +Only applies to \f[V]Individual\f[R] authentication. +.RE +.IP \[bu] 2 +\f[B]\f[VB]-ai|--all-interactive\f[B]\f[R] +.RS 2 +.PP +Makes every page interactive by applying an interactive render mode at the top level. +If \f[V]false\f[R], pages use static server-side rendering by default and can be marked interactive on a per-page or per-component basis. +This option is only effective if the \f[V]-i|--interactivity\f[R] option isn\[cq]t set to \f[V]None\f[R]. +.RE +.IP \[bu] 2 +\f[B]\f[VB]--no-https\f[B]\f[R] +.RS 2 +.PP +Turns off HTTPS. +This option only applies if \f[V]Individual\f[R] isn\[cq]t chosen for the \f[V]-au|--auth\f[R] option. +.RE +.IP \[bu] 2 +\f[B]\f[VB]--use-program-main\f[B]\f[R] +.RS 2 +.PP +If specified, an explicit \f[V]Program\f[R] class and \f[V]Main\f[R] method is generated instead of top-level statements. +.RE .PP * * * * * .SS \f[V]blazorwasm\f[R] @@ -951,6 +1104,11 @@ Default value T} _ T{ +8.0 +T}@T{ +\f[V]net8.0\f[R] +T} +T{ 7.0 T}@T{ \f[V]net7.0\f[R] @@ -1000,6 +1158,7 @@ The possible values are: \f[V]IndividualB2C\f[R] - Individual authentication with Azure AD B2C. .IP \[bu] 2 \f[V]SingleOrg\f[R] - Organizational authentication for a single tenant. +Entra External ID tenants also use SingleOrg. .RE .IP \[bu] 2 \f[B]\f[VB]--authority \f[B]\f[R] @@ -1185,6 +1344,16 @@ Default value T} _ T{ +8.0 +T}@T{ +\f[V]net8.0\f[R] +T} +T{ +7.0 +T}@T{ +\f[V]net7.0\f[R] +T} +T{ 6.0 T}@T{ \f[V]net6.0\f[R] @@ -1263,6 +1432,7 @@ The possible values are: \f[V]IndividualB2C\f[R] - Individual authentication with Azure AD B2C. .IP \[bu] 2 \f[V]SingleOrg\f[R] - Organizational authentication for a single tenant. +Entra External ID tenants also use SingleOrg. .IP \[bu] 2 \f[V]MultiOrg\f[R] - Organizational authentication for multiple tenants. .IP \[bu] 2 @@ -1383,6 +1553,16 @@ Default value T} _ T{ +8.0 +T}@T{ +\f[V]net8.0\f[R] +T} +T{ +7.0 +T}@T{ +\f[V]net7.0\f[R] +T} +T{ 6.0 T}@T{ \f[V]net6.0\f[R] @@ -1450,6 +1630,8 @@ Default value: \f[V]false\f[R]. .PP * * * * * .SS \f[V]angular\f[R], \f[V]react\f[R] +.PP +\f[B]Discontinued since .NET 8 SDK.\f[R] .IP \[bu] 2 \f[B]\f[VB]-au|--auth \f[B]\f[R] .RS 2 @@ -1498,6 +1680,10 @@ Specifies the framework to target. Option not available in .NET Core 2.2 SDK. .PP The following table lists the default values according to the SDK version number you\[cq]re using: +.RS +.PP +There isn\[cq]t a React template for \f[V]net8.0\f[R], however, if you\[cq]re interested in developing React apps with ASP.NET Core, see Overview of Single Page Apps (SPAs) in ASP.NET Core. +.RE .PP .TS tab(@); @@ -1509,6 +1695,11 @@ Default value T} _ T{ +7.0 +T}@T{ +\f[V]net7.0\f[R] +T} +T{ 6.0 T}@T{ \f[V]net6.0\f[R] @@ -1558,87 +1749,6 @@ If specified, an explicit \f[V]Program\f[R] class and \f[V]Main\f[R] method will Available since .NET SDK 6.0.300. Default value: \f[V]false\f[R]. .RE -.PP - * * * * * -.SS \f[V]reactredux\f[R] -.IP \[bu] 2 -\f[B]\f[VB]--exclude-launch-settings\f[B]\f[R] -.RS 2 -.PP -Excludes \f[I]launchSettings.json\f[R] from the generated template. -.RE -.IP \[bu] 2 -\f[B]\f[VB]-f|--framework \f[B]\f[R] -.RS 2 -.PP -Specifies the framework to target. -Option not available in .NET Core 2.2 SDK. -.PP -The following table lists the default values according to the SDK version number you\[cq]re using: -.PP -.TS -tab(@); -l l. -T{ -SDK version -T}@T{ -Default value -T} -_ -T{ -6.0 -T}@T{ -\f[V]net6.0\f[R] -T} -T{ -5.0 -T}@T{ -\f[V]net5.0\f[R] -T} -T{ -3.1 -T}@T{ -\f[V]netcoreapp3.1\f[R] -T} -T{ -3.0 -T}@T{ -\f[V]netcoreapp3.0\f[R] -T} -T{ -2.1 -T}@T{ -\f[V]netcoreapp2.0\f[R] -T} -.TE -.PP -To create a project that targets a framework earlier than the SDK that you\[cq]re using, see \f[V]--framework\f[R] for \f[V]console\f[R] projects earlier in this article. -.RE -.IP \[bu] 2 -\f[B]\f[VB]--no-restore\f[B]\f[R] -.RS 2 -.PP -Doesn\[cq]t execute an implicit restore during project creation. -.RE -.IP \[bu] 2 -\f[B]\f[VB]--no-https\f[B]\f[R] -.RS 2 -.PP -Turns off HTTPS. -.RE -.IP \[bu] 2 -\f[B]\f[VB]--kestrelHttpPort\f[B]\f[R] -.RS 2 -.PP -Port number to use for the HTTP endpoint in \f[I]launchSettings.json\f[R]. -.RE -.IP \[bu] 2 -\f[B]\f[VB]--kestrelHttpsPort\f[B]\f[R] -.RS 2 -.PP -Port number to use for the HTTPS endpoint in \f[I]launchSettings.json\f[R]. -This option is not applicable when the parameter \f[V]no-https\f[R] is used (but \f[V]no-https\f[R] is ignored when an individual or organizational authentication setting is chosen for \f[V]--auth\f[R]). -.RE .PP * * * * * .SS \f[V]razorclasslib\f[R] @@ -1720,6 +1830,7 @@ The possible values are: \f[V]IndividualB2C\f[R] - Individual authentication with Azure AD B2C. .IP \[bu] 2 \f[V]SingleOrg\f[R] - Organizational authentication for a single tenant. +Entra External ID tenants also use SingleOrg. .IP \[bu] 2 \f[V]Windows\f[R] - Windows authentication. .RE @@ -1736,8 +1847,8 @@ The default value is \f[V]https://login.microsoftonline.com/tfp/\f[R]. .RS 2 .PP Create a project that uses the ASP.NET Core minimal API. -Default is \f[V]false\f[R], but this option is overridden by \f[V]--controllers\f[R]. -Since the default for \f[V]--controllers\f[R] is \f[V]false\f[R], entering \f[V]dotnet new webapi\f[R] without specifying either option creates a minimal API project. +Default is \f[V]false\f[R], but this option is overridden by \f[V]-controllers\f[R]. +Since the default for \f[V]-controllers\f[R] is \f[V]false\f[R], entering \f[V]dotnet new webapi\f[R] without specifying either option creates a minimal API project. .RE .IP \[bu] 2 \f[B]\f[VB]-ssp|--susi-policy-id \f[B]\f[R] @@ -1763,12 +1874,13 @@ Use with \f[V]IndividualB2C\f[R] or \f[V]SingleOrg\f[R] authentication. The default value is \f[V]11111111-1111-1111-11111111111111111\f[R]. .RE .IP \[bu] 2 -\f[B]\f[VB]--controllers\f[B]\f[R], \f[B]\f[VB]--use-controllers\f[B]\f[R] +\f[B]\f[VB]-controllers|--use-controllers\f[B]\f[R] .RS 2 .PP Whether to use controllers instead of minimal APIs. If both this option and \f[V]-minimal\f[R] are specified, this option overrides the value specified by \f[V]-minimal\f[R]. Default is \f[V]false\f[R]. +Available since .NET 8 SDK. .RE .IP \[bu] 2 \f[B]\f[VB]--domain \f[B]\f[R] @@ -1841,6 +1953,11 @@ Default value T} _ T{ +8.0 +T}@T{ +\f[V]net8.0\f[R] +T} +T{ 7.0 T}@T{ \f[V]net7.0\f[R] @@ -1888,6 +2005,25 @@ If specified, an explicit \f[V]Program\f[R] class and \f[V]Main\f[R] method will Available since .NET SDK 6.0.300. Default value: \f[V]false\f[R]. .RE +.PP + * * * * * +.SS \f[V]apicontroller\f[R] +.PP +API Controller with or without read/write actions. +.IP \[bu] 2 +\f[B]\f[VB]-p:n|--name \f[B]\f[R] +.RS 2 +.PP +The namespace for the generated code. +Default is \f[V]MyApp.Namespace\f[R]. +.RE +.IP \[bu] 2 +\f[B]\f[VB]-ac|--actions\f[B]\f[R] +.RS 2 +.PP +Create a controller with read/write actions. +Default is \f[V]false\f[R]. +.RE .PP * * * * * .SS \f[V]globaljson\f[R] @@ -1897,6 +2033,13 @@ Default value: \f[V]false\f[R]. .PP Specifies the version of the .NET SDK to use in the \f[I]global.json\f[R] file. .RE +.IP \[bu] 2 +\f[B]\f[VB]--roll-forward \f[B]\f[R] +.RS 2 +.PP +The roll-forward policy to use when selecting an SDK version, either as a fallback when a specific SDK version is missing or as a directive to use a later version. +For more information, see global-json. +.RE .SS \f[V]editorconfig\f[R] .PP Creates an \f[I].editorconfig\f[R] file for configuring code style preferences. diff --git a/documentation/manpages/sdk/dotnet-new-search.1 b/documentation/manpages/sdk/dotnet-new-search.1 index f904c1d09971..c5411ca680ba 100644 --- a/documentation/manpages/sdk/dotnet-new-search.1 +++ b/documentation/manpages/sdk/dotnet-new-search.1 @@ -14,7 +14,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "dotnet-new-search" "1" "2023-10-25" "" ".NET Documentation" +.TH "dotnet-new-search" "1" "2024-10-02" "" ".NET Documentation" .hy .SH dotnet new search .PP @@ -28,9 +28,9 @@ dotnet-new-search - searches for the templates supported by dotnet-new on NuGet. \f[C] dotnet new search -dotnet new search [] [--author ] [-lang|--language {\[dq]C#\[dq]|\[dq]F#\[dq]|VB}] +dotnet new search [] [--author ] [-lang|--language ] [--package ] [--tag ] [--type ] - [--columns ] [--columns-all] + [--columns ] [--columns-all] [-d|--diagnostics] [--verbosity ] [-h|--help] \f[R] .fi @@ -63,7 +63,7 @@ To activate tab completion for the .NET SDK, see Enable tab completion. .RS 2 .PP If the argument is specified, only templates containing \f[V]\f[R] in the template name or short name will be shown. -The argument is mandatory when \f[V]--author\f[R], \f[V]--language\f[R], \f[V]--package\f[R], \f[V]--tag\f[R] or \f[V]--type\f[R] options are not specified. +The argument is mandatory when \f[V]--author\f[R], \f[V]--language\f[R], \f[V]--package\f[R], \f[V]--tag\f[R], or \f[V]--type\f[R] options are not specified. .RS .PP Starting with .NET SDK 6.0.100, you can put the \f[V]\f[R] argument after the \f[V]--search\f[R] option. @@ -77,26 +77,26 @@ Using more than one argument is not allowed. .RS 2 .PP Filters templates based on template author. -Partial match is supported. +A partial match is supported. .RE .IP \[bu] 2 \f[B]\f[VB]--columns \f[B]\f[R] .RS 2 .PP -Comma-separated list of columns to display in the output. +The list of columns to display in the output. The supported columns are: .IP \[bu] 2 -\f[V]language\f[R] - A comma-separated list of languages supported by the template. +\f[V]author\f[R] - The template author. .IP \[bu] 2 -\f[V]tags\f[R] - The list of template tags. +\f[V]language\f[R] - The template language. .IP \[bu] 2 -\f[V]author\f[R] - The template author. +\f[V]tags\f[R] - The list of template tags. .IP \[bu] 2 -\f[V]type\f[R] - The template type: project or item. +\f[V]type\f[R] - The template type. .PP -The template name, short name, package name and total downloads count are always shown. -The default list of columns is template name, short name, author, language, package, and total downloads. -This list is equivalent to specifying \f[V]--columns=author,language\f[R]. +The template name, short name, package name, an indication if it\[cq]s a trusted source, and total downloads count are always shown. +The default list of columns is template name, short name, language, package, an indication if it\[cq]s a trusted source, and total downloads. +To specify multiple columns, use the \f[V]--columns\f[R] option multiple times. .RE .IP \[bu] 2 \f[B]\f[VB]--columns-all\f[B]\f[R] @@ -119,11 +119,11 @@ Prints out help for the search command. Available since .NET SDK 7.0.100. .RE .IP \[bu] 2 -\f[B]\f[VB]-lang|--language {C#|F#|VB}\f[B]\f[R] +\f[B]\f[VB]-lang|--language \f[B]\f[R] .RS 2 .PP Filters templates based on language supported by the template. -The language accepted varies by the template. +The language accepted varies by the template, possible languages are C#, F#, VB, SQL, JSON, TypeScript, and more. Not valid for some templates. .RS .PP @@ -137,7 +137,7 @@ For example, \f[V]dotnet new --search --language \[dq]F#\[dq]\f[R]. .RS 2 .PP Filters templates based on NuGet package ID. -Partial match is supported. +A partial match is supported. .RE .IP \[bu] 2 \f[B]\f[VB]--tag \f[B]\f[R] @@ -202,7 +202,7 @@ Search for all C# templates, showing the type and tags in the output. .IP .nf \f[C] -dotnet new search --language \[dq]C#\[dq] --columns \[dq]type,tags\[dq] +dotnet new search --language \[dq]C#\[dq] --columns \[dq]type\[dq] --columns \[dq]tags\[dq] \f[R] .fi .RE diff --git a/documentation/manpages/sdk/dotnet-new-uninstall.1 b/documentation/manpages/sdk/dotnet-new-uninstall.1 index a2dc561dfd43..f9838d1a963f 100644 --- a/documentation/manpages/sdk/dotnet-new-uninstall.1 +++ b/documentation/manpages/sdk/dotnet-new-uninstall.1 @@ -14,7 +14,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "dotnet-new-uninstall" "1" "2023-10-25" "" ".NET Documentation" +.TH "dotnet-new-uninstall" "1" "2024-10-02" "" ".NET Documentation" .hy .SH dotnet new uninstall .PP diff --git a/documentation/manpages/sdk/dotnet-new-update.1 b/documentation/manpages/sdk/dotnet-new-update.1 index 05a237913b61..b96cc6b9b9d3 100644 --- a/documentation/manpages/sdk/dotnet-new-update.1 +++ b/documentation/manpages/sdk/dotnet-new-update.1 @@ -14,7 +14,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "dotnet-new-update" "1" "2023-10-25" "" ".NET Documentation" +.TH "dotnet-new-update" "1" "2024-10-02" "" ".NET Documentation" .hy .SH dotnet new update .PP @@ -80,6 +80,10 @@ For more information, see Common NuGet Configurations. Available since .NET SDK 7.0.100. .RE .IP \[bu] 2 +\f[B]\f[VB]--check-only|--dry-run\f[B]\f[R] +.PP +Only checks for updates and displays the template packages to be updated, without applying any updates. +.IP \[bu] 2 \f[B]\f[VB]-d|--diagnostics\f[B]\f[R] .RS 2 .PP diff --git a/documentation/manpages/sdk/dotnet-new.1 b/documentation/manpages/sdk/dotnet-new.1 index aba30cb7f9a3..164fb0b70674 100644 --- a/documentation/manpages/sdk/dotnet-new.1 +++ b/documentation/manpages/sdk/dotnet-new.1 @@ -15,7 +15,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "dotnet-new" "1" "2023-10-25" "" ".NET Documentation" +.TH "dotnet-new" "1" "2024-10-02" "" ".NET Documentation" .hy .SH dotnet new