iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🕌

Publishing VSBuild artifacts to Artifacts in Azure Pipelines

に公開

When building .NET, in my personal experience, I find using NuGetCommand to be quite convenient.

However, in the case of old-style .csproj files that are not SDK-style, it can be difficult without using VSBuild. In such cases, the build artifacts are not located in the usual bin/Release folder or similar locations.

There are several ways to handle this, but if you ultimately intend to publish them to Artifacts, I feel that specifying $(Build.ArtifactStagingDirectory) in the MSBuild parameters, as shown below, is the most direct and easy approach.

- task: VSBuild@1
  inputs:
    solution: '$(solution)'
    msbuildArgs: '-p:OutputPath=$(Build.ArtifactStagingDirectory)'
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

That's all.

Discussion