microsoft / azure-pipelines-agent

Azure Pipelines Agent 🚀
MIT License
1.72k stars 864 forks source link

[BUG]: vsts agent doesn't show warnings shown in visual studio. #4414

Closed RickardAhlbom closed 1 year ago

RickardAhlbom commented 1 year ago

What happened?

I have vsts on prem agents on a windows server machine with version 2.202.0 that builds a .net 6 project. On my local machine I have Visual studio installed, The information is pasted later in the post below. I have added the following to have code analyzed with roslyn.

net6.0 latest-recommended

in the csproj and I get the following warning when building locally:

Severity Code Description Project File Line Suppression State Detail Description Warning CA1850 Prefer static 'System.Security.Cryptography.SHA1.HashData' method over 'ComputeHash' FormService.Infrastructure C:\x\y\Storage\AzureStorageService.cs 212 Active It is more efficient to use the static 'HashData' method over creating and managing a HashAlgorithm instance to call 'ComputeHash'.

When running the build in azure devops pipeline i have the following arguments to .net core build --no-restore -p:VersionPrefix=$(BuildNumber) -warnaserror

But the build doesn't find the warning. What am I doing wrong? I want to prevent warnings from passing through the pipeline in the future.

Microsoft Visual Studio Enterprise 2022 Version 17.7.3 VisualStudio.17.Release/17.7.3+34024.191 Microsoft .NET Framework Version 4.8.04084

Installed Version: Enterprise

Visual C++ 2022 00476-80000-00000-AA318 Microsoft Visual C++ 2022

ASP.NET and Web Tools 17.7.273.65229 ASP.NET and Web Tools

Azure App Service Tools v3.0.0 17.7.273.65229 Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools 17.7.273.65229 Azure Functions and Web Jobs Tools

C# Tools 4.7.0-3.23416.8+43b0b05cc4f492fd5de00f6f6717409091df8daa C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Cookiecutter 17.0.23189.3 Provides tools for finding, instantiating and customizing templates in cookiecutter format.

GitHub Copilot 1.100.0.0 (v1.100.0.0@6ff082509) GitHub Copilot is an AI pair programmer that helps you write code faster and with less work.

GitHub Copilot Agent 1.100.306 (v1.100.0)

Microsoft Azure Tools for Visual Studio 2.9 Support for Azure Cloud Services projects

Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Node.js Tools 1.5.50628.1 Commit Hash:f9e713b25f69afd3ced63d934e0722003b73c121 Adds support for developing and debugging Node.js apps in Visual Studio

NuGet Package Manager 6.7.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Python - Django support 17.0.23189.3 Provides templates and integration for the Django web framework.

Python - Profiling support 17.0.23189.3 Profiling support for Python projects.

Python with Pylance 17.0.23189.3 Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.

Razor (ASP.NET Core) 17.7.3.2333001+0ab18affdf2a37647768d0e25f5f021bee6257a1 Provides languages services for ASP.NET Core Razor.

SQL Server Data Tools 17.7.10.1 Microsoft SQL Server Data Tools

Test Adapter for Boost.Test 1.0 Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test 1.0 Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory.

TypeScript Tools 17.0.20628.2001 TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 4.7.0-3.23416.8+43b0b05cc4f492fd5de00f6f6717409091df8daa Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 17.7.0-beta.23314.10+e612cf93b989503c89e3a5830090062b7ab5e143 Microsoft Visual F# Tools

Visual Studio IntelliCode 2.2 AI-assisted development for Visual Studio.

Versions

2.202.0/ Windows server 2016 standard - 10.0.14393 Build 14393

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

No response

Version controll system

No response

Relevant log output

No response

max-zaytsev commented 1 year ago

@RickardAhlbom thank you for reporting this. This doesn't seem to be an issue with the agent itself, can you please post this question at Microsoft Developer Community.