Senior Software Consultant C#, DevOps, Cloud

How I became a software consultant 2

How I became a Software Consultant

This is a true story about my career leading up to me being able to jump ship and become a small business owner, and a freelance software consultant, earning 3 times as much as my highest software developer salary and having a blast! Disclaimer: This is a very honest blog post, and I have changed all names of the companies and people in the post to protect their privacy and brand. This post is meant to give an honest and sincere representation of my road to becoming a software consultant. So others can see the ups and downs in my career. It is not meant to shame or otherwise harm anyone else, therefore are all the names changed. Student developer job Back in 2012, I 22 years old and was...

Git does not remember username and password 3

Git does not remember username and password on Windows

Git does not remember username and password…! I was having issues, where Git would not remember my credentials for some repositories on Windows. Usually, the repositories are stored on AzureDevops and use Windows Authentication as default, with PAT (Personal Access Token) as a fallback. In this case, since I am not an employee in the company, I was given a PAT. But git kept asking me to enter credentials for every operation against the repository origin and it was making me crazy that it was not remembering my credentials. Make sure that you are using Windows Credentials manager If you are using Git on Windows, you should store your credentials in the Windows Credentials manager, so they are properly encrypted and protected. You can check this by running the following...

7

10 tips for conducting code reviews

Code reviews are a common part of most development teams workflow these days and for good reason. Code reviews give us a process of keeping code quality high, sharing knowledge. catching mistakes and keeping a consistent code base. If you use git, you probably already heard about pull-requests, which basically is a merge request with a code review requirement. I help teams learn to conduct productive and positive code reviews, so the process becomes an enjoyable part of their development life-cycle. Here are my 10 tips for conducting a productive and positive code review, that gives value to both the reviewer and the author(s). 1. Figure out what the goal of the code review is Something that often happens in teams that are new to code reviews, is that the...

0

You don’t need a IDesignTimeDbContextFactory

If you have ever gotten the error message, that tells you to add IDesignTimeDbContextFactory to your project, when doing EF Core migrations. This particular one: Unable to create an object of type ‘MyContext’. Add an implementation of ‘IDesignTimeDbContextFactory’ to the project, or see https://go.microsoft.com/fwlink/?linkid=851728 for additional patterns supported at design time. You will probably be scratching your head, asking some questions and maybe even swear a little. Because the console will tell you to implemnt a IDesignTimeDbContextFactory so that is But don’t fret, you don’t need one. You can avoid it by having making sure of the following: The entire solution must be buildable and be able to run! If you have a project that cannot build, you can exclude it with the build configuration manager. Default constructor For the system to...

Nuget + XML docs + Swagger 0

Add NuGet package XML documentation to Swagger

Copy XML documentation from NuGet package to project build folder! At my current client, we are building an API that is put together by re-usable “API parts”, eg. ASP.NET Core Application Parts, which works wonders by the way. We can have multiple parts of the API split into small NuGet packages that can be re-used in other systems, that way we only have to implement system specific code, the rest is reused, including documentation etc. Talking about documentation, brings us directly to the issue. We use SwashBuckle to generate our Swagger definition and Swagger UI, and Swashbuckle requires XML documentation, to be able to include documentation from our Controllers and models. I thought we could probably just add a checkbox “Add XML documentation from NuGet package, on build”, but… Unfortunately...

C# 8 records 4

Immutable Records could be added in C# 8.x

There are talks about this feature being postponed to a minor version after 8.0 is released, as it might not be ready for the major C# 8.0 release. The features for C# 8.0 still hasn’t been decided yet, so that means this information is still subject to change! Since Microsoft rebuilt the C# compiler into what is now the Roslyn compiler, the language teams’ feature implementation speed has been phenomenal, they are cranking features out in record time.  Pro C# 7: With .NET and .NET Core Microsoft is committed to continuously update the C# language. They have even given us incremental updates of features that were not yet ready for the major versions release date and subsequently added it in minor language updates, such as C# 7.1, 7.2 and 7.3....

5

Hunting .NET memory leaks with Windbg

Recently a client called me about an issue where one of their production servers would run out of memory, every other week. The application in question was a .NET Framework 4.5 Windows service, that runs in an Azure VM, and ever so often it would become unstable and start causing trouble. I have previously helped this client set up an ELK stack, so it was quick for me to go into Kibana, look at metricbeat data, and see that their server indeed slowly was eating up memory over time. And every time the application was restarted, the memory would return to normal, and slowly creep upwards again. As you can clearly see, the application uses gradually more and more memory over time. Every time the line drops, was a restart...

Software consultant 1

10 tips and tricks for solving software problems

As software consultants, we are often faced with bugs or problems the client cannot fix themselves. We are expected to quickly figure out the problem, and propose or implement a solution. Through my career I have developed a sort of mindset to get to the bottom of issues without wasting time hunting deadends or non-issues, and deliver results and value more efficiently. Here is my list of 10 tips for how I go about solving software problems 1. Focus A common problem I saw in myself, and I see very often in software developers, is a lack of focus. If you are trying to solve too many issues at once, you will probably fail at all of them. The first thing you must do, is figure out what you are...

Redis connection lost 0

Redis connection issues

At my current client, we have been dealing with an ongoing problem while scaling their cloud systems to the ever increasing customer-base. As it is with any software that needs to scale, we’ve been seeing and solving scalability problems along the way. Anyone who has ever dealt with scaling a system to accommodate a lot of concurrent users, knows that issues will be showing up places you aren’t expecting. While scaling the system, we’ve made it more resilient and fault tolerant, and also learned to mitigate many of the problems as they are arising. We’ve improved logging and metrics, so we know exactly what is happening, and can see stability problems before they affect the end-users. Redis loses connection, and will not reconnect In our system, we use StackExchange.Redis(v1.2.6) to...

1

Re-use Controllers, Views and Tag-helpers in ASP.NET Core

I recently ran into a situation, where I needed to implement the same functionality, the same views and even the same tag-helpers for different customers. Like most other developers I hate copy-pasting code that should be shared across multiple projects. I had come across a similar need a few years back, but remembered that it was cumbersome in ASP.NET 3-5, to achieve this, and the solutions back then didn’t feel right. But since my recent switch to dotnet core, I knew there was a chance that Microsoft had a prepared an early christmas present for me. So I started researching my options, searching for titles similar to this blog post, and finally found a solution on the third place on google (Yes I was that desperate). Introducing Application Parts /...