Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

431
Views
¿Cómo puedo agregar a la colección de propiedades extendidas de una compilación en canalizaciones de Azure Devops?

Uso las bibliotecas de cliente de .NET para Azure DevOps para obtener información sobre mis compilaciones y mostrarlas en un sitio web. Quiero obtener la versión ensamblada de mi aplicación que se está creando para mostrarla en el sitio web.

Veo aquí que hay una colección de pares clave-valor arbitrarios que puedo obtener a través de la API REST (y también con la biblioteca del cliente dotnet). Pero, ¿cómo configuro estas propiedades durante mi compilación?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Quiero obtener la versión ensamblada de mi aplicación que se está creando para mostrarla en el sitio web.

Puede usarReflector , ILDASM , Jetbrains dotpeek o ILSpy para obtener la versión ensamblada.

Por lo general, puede encontrar ILDASM en C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\ildasm.exe (donde v8.1A es la versión de Windows SDK instalada).

ILDASM: Ildasmtooltoseeversion

ingrese la descripción de la imagen aquí

ingrese la descripción de la imagen aquí

¿Cómo configuro estas propiedades durante mi compilación? Debe establecer propiedades extendidas en forma de variables de entorno.

Puede usar variables con expresiones para asignar valores de forma condicional y personalizar aún más las canalizaciones.

over 4 years ago · Santiago Trujillo Report

0

Use esta plantilla de tarea YAML llamada SetBuildProperties.yml para agregar propiedades de compilación en una canalización:

SetBuildProperties.yml:

 # Sets custom build properties. Use this to transfer info between pipelines. parameters: - name: buildId type: string steps: - task: PowerShell@2 displayName: 'Set build properties' name: 'SetBuildProperties' inputs: targetType: 'inline' script: | # prepare the auth token $authHeader = "Bearer $(System.AccessToken)" $requestHeader = @{ "Authorization" = $authHeader "Accept" = "application/json" } # array of operations # @{} is a hashtable in PowerShell. # @() is an array (list) in PowerShell. $paramsObject = @( @{ "op" = "add" "path" = "/myProperty" "value" = "myValue" } ) $params = ConvertTo-Json -InputObject $paramsObject Write-Host "JSON: " $params $contentType = "application/json-patch+json;charset=utf-8" $apiurl = "https://dev.azure.com/MyOrg/MyProject/_apis/build/builds/${{ parameters.buildId }}/properties?api-version=6.0" Write-Host "Invoking REST API url: " $apiurl try { $properties = Invoke-RestMethod -Uri $apiurl -Method PATCH -Headers $requestHeader -Body $params -ContentType $contentType } catch { # Writes an error to build summary and to log in red text Write-Host "##vso[task.LogIssue type=error;]Error occurred: " $_ exit 1 }

Si necesita leer las propiedades en la misma tubería o en una diferente, puede usar esta plantilla GetBuildProperties.yml:

 # Gets custom build properties. Use this to transfer info between pipelines. parameters: - name: buildId type: string steps: - task: PowerShell@2 displayName: 'Get build properties' name: 'GetBuildProperties' inputs: targetType: 'inline' script: | # prepare the auth token $authHeader = "Bearer $(System.AccessToken)" $requestHeader = @{ "Authorization" = $authHeader "Accept" = "application/json" } $apiurl = "https://dev.azure.com/MyOrg/MyCompany/_apis/build/builds/${{ parameters.buildId }}/properties?api-version=6.0" Write-Host "Invoking REST API url: " $apiurl try { $properties = Invoke-RestMethod -Uri $apiurl -Method Get -Headers $requestHeader $propertiesJSON = ConvertTo-Json -InputObject $properties Write-Host 'properties: ' $propertiesJSON } catch { # Writes an error to build summary and to log in red text Write-Host "##vso[task.LogIssue type=error;]Error occurred: " $_ exit 1 }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!