Understanding Git Garbage Collection

Garbage collection is a well known software practice. The garbage collector, or just collector, attempts to reclaim garbage, or memory occupied by objects that are no longer in use by the program. When we talk about the Git Garbage Collection, we mean almost the same thing. Git garbage collector runs a number of housekeeping tasks within the current repository, such as compressing file revisions (to reduce disk space and increase performance), removing unreachable objects which may have been created from prior invocations of git add, packing refs, pruning reflog or stale working trees.
Continue reading “Understanding Git Garbage Collection”

Publishing Dotnet Core creates multiples nested directories

This is one of the errors that we encountered in the ASP.NET core build process. To this date, this issue can be easily reproduced by creating a ASP.NET core web api process and repeating ‘dotnet publish’ command with using an output directory and parameter –output. However, it does not happen with the simple console applications.

When we try to publish files, it creates nested multiple output directories like below: Continue reading “Publishing Dotnet Core creates multiples nested directories”

Dockerfile Naming Convention and Organization

Docker files are used to create docker images. When you are building image using Dockerfile, by default it would search for a file named Dockerfile with no file extension in the current directory context. Now normally an application have multiple environments like Dev, QA, Production etc. Few things like application settings and environmental variables will generally differ from one environment to another environment. To account for these changes and for image to work properly in these different environments, it needs to be either generic in nature (which is a very rare case and puts lots of un-necessary modification in the application code itself to account for these changes at runtime) or images needs to built for each environment separately.
Continue reading “Dockerfile Naming Convention and Organization”

Deploy ASP.NET Core App as Azure Containers Instances (ACI)

Microsoft has invested billions in Azure to drive technology and also hired best of the minds on this planet. From last few months, Azure has been launching new container-focused products and services on a regular basis. One of these products is Azure Container Instances. It acts as a bridge between platform as a service and infrastructure as a service architecture. Perhaps it would be okay to call this service as “Container as a Service”. Azure Container Instances (ACI) allows to rapidly create and launch containerized applications, without any overhead and with an easily scriptable set of commands. Designed to work Continue reading “Deploy ASP.NET Core App as Azure Containers Instances (ACI)”

ASP.NET Core App fails to start with error: ‘A path base can only be configured using IApplicationBuilder.UsePathBase().’

In one of the cases with setting up builds for new source code repositories we came across this issue. One of the microservices was written in ASP.NET core using Visual Studio. It was working fine using Visual Studio or when hosted using IIS, but it fails to start with below error when using dotnet native command inside docker image. The error message was like below:

System.InvalidOperationException: A path base can only be configured using IApplicationBuilder.UsePathBase().
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.d__7.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Continue reading “ASP.NET Core App fails to start with error: ‘A path base can only be configured using IApplicationBuilder.UsePathBase().’”