Enable NuGet auditing for your .NET projects

 
 
  • Gérald Barré
A security audit for package managers like NuGet is indeed a critical process for ensuring the security of software projects. NuGet has a feature to assist with this process. It can run a security audit with the dotnet restore command, which checks your dependencies against a list of known vulnerabilities from the GitHub Advisory Database. If vulnerabilities are found, you can update the affected packages… [read more]

How to output a SARIF file from a .NET project

 
 
  • Gérald Barré
SARIF (Static Analysis Results Interchange Format) is an OASIS Standard that defines an output file format. The SARIF standard is used to streamline how static analysis tools share their results. SARIF is a JSON-based format that is easy to parse. Lots of tools support it, including Visual studio Code or Visual Studio. GitHub also supports this file format to report static analysis results. You can upload… [read more]

Improve the tree view settings in Visual Studio Code

 
 
  • Gérald Barré
I think the default settings for the tree view in Visual Studio Code are not very good. The indentation is too small, and the indentation guides are not visible enough. Here's how to improve the tree view settings: Open the VS Code settings Add the following json content to the settings: { "workbench.tree.indent": 15, "workbench.tree.renderIndentGuides": "always", "workbench.colorCustomizations": {… [read more]

Improve PowerShell performance by disabling progress bars

 
 
  • Gérald Barré
Some commands in PowerShell display progress bars. For instance, Invoke-WebRequest displays the download progression. These progress bars can slow down the execution of the commands as writing to the console takes time. If you don't need the progress bars, you can disable them to improve the performance of your scripts. Note that recent versions of PowerShell Core (7.x) have a better performance than… [read more]

Sharing the Renovate configuration across multiple projects

 
 
  • Gérald Barré
Renovate is a tool that helps you to keep your dependencies up-to-date. You can configure Renovate using a configuration file at the root of the repository. In this post, I describe how to share the Renovate configuration across multiple projects. Developers don't like to maintain the same configuration in multiple repositories. It's error-prone and time-consuming. By sharing the configuration, you can… [read more]

Create a multi-arch Docker image for a .NET application

 
 
  • Gérald Barré
We are in a transition period where x64 architectures are not the only architectures available. Apple has switched to ARM with the M1 chip, and Microsoft is also pushing for ARM now. If you want to run your application on ARM64 and x64 architectures, you need to create a Docker image for each architecture. Docker supports multi-arch images, which allow you to create a single image that can run on multiple… [read more]

How to avoid conflicts when testing your dotnet templates locally

 
 
  • Gérald Barré
When you author a dotnet template, you can use the dotnet install and dotnet new commands to create a new project based on your local template. However, dotnet install may conflict with a previous installation of the template published as a NuGet package. In this post, I describe how to avoid this conflict and how to test your template locally. dotnet has a few hidden arguments that you can use to debug… [read more]