Debugging in the dark – when logs go silent

I recently worked on a new UI-less application. The application read some data then sent it to another server over a TCP connection. There could be lots of data and several servers so the application was multithreaded. Every few hours the application would stop responding. Windows reported the service was running so I know it

Read More

New website, new blog!

Hello and welcome to my all new website! Here you will find information on me as well as frequent blog updates. I’m very excited to start writing again. This blog will mainly contain topics revolving around .NET development and SQL server. I will be adding old posts I wrote on my previous blog. I hope

Read More

String.Join Method

Fun fact – System.String has 44 methods in .NET 4.7.1 Let’s say you have a collection of Strings you need to display as a CSV. Seems simple enough. It’s not difficult to write a method to loop the collection of Strings and build up one CSV. Then you realize you have an extra comma on

Read More

ILMerge

Have you ever written a small, single purpose application? Mine usually start out simple, then I want to add more features to make it better for the user. Let’s say we’re building a utility to test network speed. We want our application to read from a database and write to the Windows event log. We

Read More

Refactoring Code in Visual Studio 2017

How often do you clean your car? How often do you clean your code? If your answer is never you should consider reserving some time to refactor problem areas of your code. Clean code is easier to test and debug, so the time spent refactoring will likely be worth it in the end. Visual Studio

Read More

ExceptionDispatchInfo – Keep the stack trace

Exceptions happen. It could be due to programming error, a server being offline or maybe your permissions to read a file were revoked. We need to make sure our application handles the exception and log it so we can analyze it later. What’s worse than an exception? An exception without a stack trace. In most

Read More

Encryption – Why developers should care

Encryption on the web is like backing up your hard drive – we all know we should be doing it, but there is always something in the way. What are the common excuses? For some it is the cost of the certificate. For others it is the complexity of exporting then importing. In reality it

Read More

The ExpandoObject

I’ve spent most if my time programming in strongly types languages. When I see code that is not implicitly typed my immediate reaction is to expect a world of hurt. However, there are many popular languages that are not strongly typed. Even when using a strongly typed language there are times when you need an

Read More

Immutable Collections

If you are given a List<T> or even a ReadOnlyList<T> what guarantee is there that the list will not change? The answer is there is no guarantee. The owner of that list can change the contents at any time. What if a class could give you that guarantee?  The Systems.Collections.Immutable namespace does just that. In

Read More

SQL Windowing Functions

An extremely common use of SQL Server is grouping and aggregating data for reports. A simple example is to use the SUM() function with the GROUP BY clause to calculate a total for a particular group. For example, you can find the monthly sales for a product quite easily. All examples are written for the

Read More