I learned a new thing in C#, so it’s time to write a (small) blog again. This time it is about starting other programs. Starting an executable Sometimes, you need to start an external executable on your server. This can be a PowerShell script, some Python code, or an .exe file. Let’s not dwell on…
Author: admin
Monthly learnings from C# (April 2023)
I’m alive! There are no great things I’ve learned or need to remember for a while, but I decided that collecting the small things is also worthwhile. So, here are several things I learned about the last month. .ToLookup() Sometimes, you have a big list of Things. A Thing, for example, has the properties Id,…
Building Blazor on Azure DevOps
Blazor Web App As a new project I am building a piece of software on the bleeding edge again! This is a web application that should still be usable when offline and sync any actions (like adding or editing records) when back online. A perfect project to try out a Progressive Web App (or PWA)…
Working from home – my setup
In a previous post I wrote about working in COVID19 times. Setting up a personal workspace is very personal (😉) and having some inspiration would definitely help. Mine evolved throughout several months and is finally at a place I’m happy with. So, let’s see what my office looks like now. So, what have we got…
Unit Testing MVC Responses
Something I keep having to look up is testing MVC (5) responses. There are several types of responses you can return on a MVC method: Plain ol’ object. IHttpActionResult. HttpResponseMessage. Plain ol’ object Returning an object means that it will be converted to the format in the Request (e.g. JSON, XML). However, you have no…
Working from home in difficult times
I write this in a strange time. COVID19 is still at a high, so like many other professionals I’m forced to work from home. While I did this before a few times, I never did it full time. So, here are some tips I have from my experience: Work station You work station is very…
Unit testing file input
Unit tests are mandatory for any business logic. But what if your business logic is parsing and processing files? Then you will need files as input in your tests. At first, I thought about making an extra wrapper around reading the file and mocking the wrapper when parsing it. However, sometimes this is more complicated…
.NET Core Authorizations with Active Directory
Some things sound too easy to do, but still end up eating a lot of time researching how to do it. Recently I made a small Web Application that had to integrate with Active Directory. To be precise: only a specific set of Active Directory groups is allowed to make use of the website functionality….
Unit test snippets
I am a big fan of making things easy for myself. When preparing the TDD Workshop for another round I found it increasingly tedious to type out every unit test function. Luckily, Visual Studio lets you create your own snippets, so I created one that would immediately generate something like this:
NServiceBus will ruin your SQLite operation
NServiceBus is great! Transactionality, automatic retry mechanism and a whole sleuth of guarantees. In a quick glance it is just a wrapper around your favorite messaging queues, but there is a lot underneath. I’ve heard rumors in fact, that if you find a bug in NServiceBus (a lost message in particular) Particular Software will personally…