应用程序服务如何更改 msbuild 项目构建输出的详细程度

问题描述 投票:0回答:1

使用 VS 2022 构建我的 .net 4.8 项目。

我已经清理了大部分警告,只剩下一两个。

当前 MSBuild 项目 buid 输出详细级别设置为“最小”

enter image description here

但是,当我将项目推送到应用程序服务管道并且构建完成时,我收到 140 条警告。

有些事情就这么简单

Warning CS1570: XML comment has badly formed XML -- 'End tag 'summary' does not match the start tag 'T'.'

我不需要看到。

我们正在使用模板构建管道。

如何更改构建输出以匹配 VS 中的输出 - 最小

c# azure azure-web-app-service
1个回答
0
投票

我同意Dai,您需要对您的

Ci/Cd
构建管道进行更改。以下是如何在 Azure Devops yaml 管道中将详细程度添加到最低限度:-

enter image description here

enter image description here

管道代号:-

trigger:
  branches:
    include:
      - main

jobs:
- job: Build
  displayName: 'Build and Publish'
  pool:
    vmImage: 'ubuntu-latest'
  steps:
  - task: UseDotNet@2
    displayName: 'Install .NET Core SDK'
    inputs:
      version: '6.x'

  - task: DotNetCoreCLI@2
    displayName: 'Restore Dependencies'
    inputs:
      command: 'restore'
      projects: '**/*.csproj'
      verbosityRestore: Minimal  # Setting restore verbosity to minimal

  - task: DotNetCoreCLI@2
    displayName: 'Build Project'
    inputs:
      command: 'build'
      projects: '**/*.csproj'
      arguments: '--configuration Release'
      verbosityPack: Minimal
      

  - task: DotNetCoreCLI@2
    displayName: 'Publish Project'
    inputs:
      command: 'publish'
      projects: '**/*.csproj'
      publishWebProjects: true
      arguments: '--configuration Release --output $(Build.ArtifactStagingDirectory)'
      zipAfterPublish: true
      verbosityPack: Minimal
  - task: PublishPipelineArtifact@1
    displayName: 'Publish Artifact'
    inputs:
      targetPath: '$(Build.ArtifactStagingDirectory)'
      artifactName: 'publishedApp'
      publishLocation: 'pipeline'

- job: Deploy
  displayName: 'Deploy to Azure Web App'
  dependsOn: Build
  pool:
    vmImage: 'ubuntu-latest'
  steps:
  - download: current
    artifact: 'publishedApp'

  - task: UseDotNet@2
    displayName: 'Install .NET Core SDK'
    inputs:
      version: '6.x'

  - task: AzureWebApp@1
    displayName: 'Azure Web App Deploy'
    inputs:
      azureSubscription: 'xxxx subscription (xxxxxxx6e97cb2a7)'
      appType: 'webApp'
      appName: 'silicon-webapp980'
      package: '$(Agent.BuildDirectory)/**/*.zip'
      deploymentMethod: 'auto'

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.