dotnet list

dotnet list

Today's tip is about an interesting command. Many may already know it, but in my case, since I usually work with Visual Studio, where the NuGet package manager is integrated into the IDE, it’s easy to see information about updates or package vulnerabilities without using the command line.

However, recently, while using VS Code with WSL, I received a notification from GitHub Dependabot after running my code in the pipeline, informing me about package vulnerabilities in the project.

I tested some extensions for managing NuGet packages in VS Code, but none met my expectations. Finally, I discovered that this could be done directly via the command line.

The useful commands I found were:

dotnet list solution.sln package --vulnerable  
# or
dotnet list project.csproj package --vulnerable          
Project `ProjectName` has the following vulnerable packages
   [net8.0]:
   Top-level Package                          Requested   Resolved   Severity   Advisory URL

   > Microsoft.Extensions.Caching.Memory      8.0.0       8.0.0      High       https://github.com/advisories/GHSA-qj66-m88j-hmgj
   > Npgsql                                   8.0.2       8.0.2      High       https://github.com/advisories/GHSA-x9vc-6hfv-hg8c        

I found it interesting to check for vulnerabilities via the command line, as this allows for customizing parts of the deployment pipeline and preventing vulnerable code from being pushed to production.


See more: dotnet-list-package

Sergio Paulo

Data Scientist | Python | LLM | GenAI | ML | RAG | NLP

3 个月

Nice content!

回复
Patrick Cunha

Lead Fullstack Engineer | Typescript Software Engineer | Nestjs | Nodejs | Reactjs | AWS | Rust

3 个月

Very helpful

回复
Eduardo Diogo

Senior Fullstack Engineer | Front-End focused developer | React | Next.js | Vue | Typescript | Node | Laravel | .NET | Azure | AWS

3 个月

NuGet CLI commands simplify package management!

Alexandre Germano Souza de Andrade

Senior Software Engineer | Backend-Focused Fullstack Developer | .NET | C# | Angular | React.js | TypeScript | JavaScript | Azure | SQL Server

3 个月

Interesting! Thanks for sharing Rafael Da Silva

回复
Cássio Huggentobler de Costa

Software Engineer | Tech Lead | .NET & C# | SQL & NoSQL | Google Cloud | ETL & Data visualization (Looker Studio, PowerBI)

3 个月

Very informative

回复

要查看或添加评论,请登录

Rafael Da Silva的更多文章

社区洞察

其他会员也浏览了