How to publish an artifact from Azure DevOps using the existing Publish Profile from Visual Studio?

Viewed 8

I am trying to create an artifact from Azure Pipelines for a .NET 6 Project using the following arguments for dotnet publish ( i am trying to use the publish profile from my project )

/p:PublishProfile=$(System.DefaultWorkingDirectory)\MyApp\Properties\PublishProfiles\FolderProfile.pubxml  --configuration $(BuildConfiguration) --output  $(Build.ArtifactStagingDirectory)\MyApp-Publish\

Though it seems that it doesn't respect the options from FolderProfile.pubxml and it publishes a framework-dependent build

Here is my PublishProfile

<Project>
  <PropertyGroup>
    <Configuration>Release</Configuration>
    <Platform>Any CPU</Platform>
    <PublishDir>bin\Release\net6.0\publish\win-x64\</PublishDir>
    <PublishProtocol>FileSystem</PublishProtocol>
    <_TargetId>Folder</_TargetId>
    <TargetFramework>net6.0</TargetFramework>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <SelfContained>true</SelfContained>
    <PublishSingleFile>true</PublishSingleFile>
    <PublishReadyToRun>true</PublishReadyToRun>
    <PublishTrimmed>false</PublishTrimmed>
  </PropertyGroup>
</Project>

Is there something wrong with the arguments I passed?

0 Answers
Related