Fixed incorrect dotnet build configuration#14247
Fixed incorrect dotnet build configuration#14247szelpe wants to merge 2 commits intoMicrosoftDocs:mainfrom
Conversation
The documentation incorrectly used the configuration input parameter as the built command does not use that parameter.
|
@szelpe : Thanks for your contribution! The author(s) have been notified to review your proposed change. |
|
Can you review the proposed changes? IMPORTANT: When the changes are ready for publication, adding a #label:"aq-pr-triaged" |
|
#assign-reviewer:ramiMSFT |
|
#reassign:ramiMSFT |
|
@szelpe : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. |
|
@ramiMSFT Can you review this old PR and determine whether it needs to be closed or merged? IMPORTANT: When the changes are ready for publication, add a @MicrosoftDocs/public-repo-pr-review-team |
There was a problem hiding this comment.
Pull request overview
Updates the .NET pipeline documentation example for running tests and publishing Coverlet code coverage, aiming to correct how build configuration is specified in the YAML snippet.
Changes:
- Adds a
UseDotNet@2step to install the .NET SDK before running Coverlet-based tests. - Adds a
DotNetCoreCLI@2dotnet buildstep with--configuration $(buildConfiguration)beforedotnet test.
| - task: UseDotNet@2 | ||
| inputs: | ||
| version: '8.x' | ||
| includePreviewVersions: true # Required for preview versions | ||
|
|
||
| - task: DotNetCoreCLI@2 | ||
| displayName: 'dotnet build' | ||
| inputs: | ||
| command: 'build' | ||
| arguments: '--configuration $(buildConfiguration)' | ||
|
|
There was a problem hiding this comment.
The YAML snippet starts directly with task entries, so if a reader pastes it into a new azure-pipelines.yml file as instructed, the pipeline will be invalid because tasks must be nested under steps: (and typically a pool:/trigger: are also shown or elided with # ...). Consider adding a steps: line (and optional # ...) to make the snippet self-contained and copy/pasteable.
| - task: UseDotNet@2 | ||
| inputs: | ||
| version: '8.x' | ||
| includePreviewVersions: true # Required for preview versions |
There was a problem hiding this comment.
includePreviewVersions: true will allow preview SDKs to be installed, which can make builds non-reproducible and isn’t needed when version: '8.x' targets the stable .NET 8 SDK. Either remove includePreviewVersions (or set it to false) for this general-purpose example, or change the example to explicitly show a preview version and align with the earlier guidance in this article that pairs preview installs with performMultiLevelLookup: true.
| includePreviewVersions: true # Required for preview versions |
The documentation incorrectly used the configuration input parameter as the built command does not use that parameter.