How can I make the pipeline task consider the .editorconfig file
settings?
We don't need to manually set anything about .editorconfig
in pipeline, it would work automatically when it's placed under project folder. I've just tested it both in local machine and build pipeline, it should work.
So you should:
1.Navigate to Azure Devops Repos to check if the .editorconfig
file exists in same folder with xx.csproj
file. Pay attention to the branch you choose, make sure the branch you use to run build pipeline do have the .editorconfig
file.
2.Check the content of .editorconfig
file, check if it contains statements like this:
# SA1633: File should have header
dotnet_diagnostic.SA1633.severity = none
Your .editorconfig
file won't suppress those warnings unless it contains this kind of definitions.
3.Try using different agents, I assume you're using self-agent. Which means you're calling your local VS instance to run the job and maybe there's something wrong with that. I suggest you can try running it with microsoft-hosted agent(choose windows-latest
), it works well in my side. Also, update your local VS to latest version if you continue to do it using self-agent.
4.Specify the version of nuget.exe, 4.4.0 is too old. Try using 5.3.1 and above.
Hope all above helps :)
.editorconfig
is in same folder as csproj. Contents look like[Generated/**/*.cs]
dotnet_analyzer_diagnostic.severity = none
– Dustin Metzgar