Matthew MacFarland
Matthew MacFarland

Reputation: 2729

Why does Visual Studio 2019 show errors for valid azure-pipelines.yml files?

The azure-pipelines.yml files in my solutions are working. In Visual Studio Code I use the Azure Pipelines extension and it shows no errors in the YAML syntax, but Visual Studio reports many errors for the same valid YAML files.

So far, the errors seem be only on the the NuGetCommand@2 task type and its parameters.

Why does Visual Studio report these errors? Is there option to make Visual Studio recognize the syntax?

I am using Visual Studio version 16.8.3.

enter image description here

Upvotes: 1

Views: 1776

Answers (2)

A.AontwSR
A.AontwSR

Reputation: 33

You can configure the Azure Pipelines extension in VS Code to use the yamlschema from your Azure DevOps Organization, this prevents false Problems. See README of Azure Pipelines for VS Code, heading Specific schema.

So something like this:

  1. Visit https://dev.azure.com/YOUR-ORG/_apis/distributedtask/yamlschema and save the output as YOUR-ORG-schema.json.
  2. Edit your VS Code Settings (UI) and place the full path to YOUR-ORG-schema.json in the input field "Azure-pipelines: Custom Schema File".

Upvotes: 0

WaitingForGuacamole
WaitingForGuacamole

Reputation: 4301

It seems like this is a known issue, "fixed" by disabling validation, that may not yet have made it into release:

https://developercommunity.visualstudio.com/content/problem/1276696/validation-errors-when-opening-azure-pipelinesyml.html

Upvotes: 1

Related Questions