ASP.NET Core MVC

I find myself throwing together web API’s and small web apps regularly for various purposes. Each project contains the same setup such as logging, managed config, api areas, api versioning, etc… Often I end up going into a previous project and copy-paste. I thought I would save myself a bit of time by documenting the process for each feature here.

Extension support for .Net Core application

There are various reasons why one would want to support plugins or extensions for an application. It allows third party to extend application, one can isolate development of parts of the application, and pick what to load at runtime. Whatever the motivation, this means loading .dll’s after the application has started, finding interfaces of interest and registering the… Read More »

.Net Core Console Application IoC

The default setup for .Net Core MVC application is to use IoC. You get a Startup.cs file created that contains boilerplate code for IoC. If you want to use the builtin IoC with .Net Core you have to write it yourself. Luckily the HostBuilder makes this easy. HostBuilder is provided by the Generic Host introduced in .Net Core… Read More »

Benchmarking dynamic method invocation in .Net

Benchmarking method execution through interface, base class, virtual, override, dynamic, reflection and expression trees. In .Net there are many ways to execute a method. The fastest being the straight forward call to a static method. But how does its speed compare to other methods? There are countless reasons why we sometimes can’t just make a direct call. We… Read More »

Building a voxel engine like Minecraft in Unity (2 of 2)

This is part 2 of 2. These posts are meant to give a basic introduction to voxel engines. In later posts I will dig into optimization techniques and benchmarking. In part 1 I touched on the basics of polygon mesh and voxel graphics. I also touched how a voxel world can be represented in memory to bypass some… Read More »

Building a voxel engine like Minecraft in Unity (1 of 2)

This is part 1 of 2. These posts are meant to give a basic introduction to voxel engines. In later posts I will dig into optimization techniques and benchmarking. So its that wonderful time of the year again where I play with something of my own choosing, uninterrupted for a few days. I left my work at work,… Read More »

Code sharing between VS and Unity 3D

In my previous blog post I covered how I usually set up new .Net projects. The post covered both naming convention, .Net Standard and .Net Core. In this post I will show a four ways you can share code between .Net projects and Unity 3D projects. There are several good reasons why you would like to do this.… Read More »

Setting up new .Net projects

Intro I have been a developer for somewhere around 30 years now. In my time I have created a few thousand projects of varying sizes, and for every new iteration I try to improve slightly on my previous. I also see a lot of code from others, and most what I see don’t seem care much about project… Read More »

sizeof() vs Marshal.SizeOf()

To get the size of a data type in .Net you can use sizeof()  or Marshal.SizeOf() . I’ll briefly explain the difference between the two. sizeof() sizeof()  (MSDN) can only be used on data types that have a known size at compile-time. It is compiled as a constant. If you attempt to use it on invalid data types you… Read More »

Cost of method wrapper

Introduction What happens if a method is just a wrapper for another method? Is the extra jump optimized away by compiler? Does it take much time? I thought I’d look into this and measure a bit. With the different compilers, Jits and runtimes I thought it would be fun to see what happens. I’ll use a == operator… Read More »