Posts

Showing posts from March, 2020

Tidy up - Unused Project and Nuget package reference using Visual Studio 2019

If you are a Developer/Architect using Visual Studio as IDE for your development activities, this blog post will be of your interest. During the Ignite 2021 conference, Microsoft released Visual Studio 2019 v16.9 and v16.10 Preview 1. As part of version 16.10 Preview 1, one of the cool features they introduced is to "Remove Unused References..." for any Projects and Nuget packages that are not in use. At the time of writing this blog post, we have Visual Studio Version 16.10.0 (official release) which includes this new feature.  As part of development, we generally get carried away and introduce new Nuget package references to your project and add new references to your Projects. By the end of development, you will not be 100% sure which are not being referenced and unused which means you will leave those unused project references in your application. Now you might be wondering what's the big deal in it since it doesn't harm. The advantage of removing unused project r

PostgreSQL extension for Azure Data Studio

Image
Azure Data Studio is a cross-platform modern editor focused on data development. It's available for Linux, MacOS, and Windows. Azure Data Studio inherits a lot of VS Code functionality. It supports most of VS Code's extensions like Python, R, and Kubernetes support. You can manage multiple database connections, explore database object hierarchy, set up database dashboards, Integrated Terminal (e.g. Bash, PowerShell, sqlcmd, ssh) etc. Most importantly it enhances developers day to day productivity. Pre requisites Download and Install Azure Data Studio We can extend the functionality of Azure Data Studio using extensions.We can connect to PostgreSQL using extension and query database using the Intellisense query editor. Navigate to the market place and search for Postgresql: Click on Install, it downloads the required package and installs it. Note: When I tried to install PostgreSQL on Azure Data Studio version 1.13.0 it didn't load properly later I updated to

Error Handling in .NET Core

Exception handling is one of the most important features of any application. To handle exceptions, we can use Try-Catch block in our code base. If we want to extract all the exception handling in one location .NET core provides Exception handler/middleware. This article will refer to the following sample code on GitHub: https://tinyurl.com/sqx65mn Exceptions with Try-Catch-Finally The simplest form of a try-catch block  try {    // try something here } catch (Exception ex) {   // catch an exception here }  finally {    // always run this code } You can have multiple catch blocks to handle specific exceptions like ArgumentOutOfRangeException, NullReferenceException etc. Finally block is optional, whether or not an exception has occurred, the finally block will always be executed. Generally different approach is followed for error handling for front end application (using MVC, Razor) vs WebAPI. Error handling for MVC/Razor MVC actions are