Category Archives: C#

NameOf and Obfuscators

I was wondering some time ago how the new ‘nameof‘ operator from C# 6.0 works when using .. obfuscators. Let’s write some code to verify this. I included a few other methods to get the member name (VS2015 RC was … Continue reading

Posted in .NET, C# | Tagged , | 1 Comment

On closures and captured variables

A few days ago, on the project I’m working on, I’ve stumbled on an interesting bug – an example of why it pays off to learn the ‘deeper’ areas of C# language (or any other language). Greatly simplified (and with … Continue reading

Posted in .NET, C# | Tagged , , , | Leave a comment

On assumptions and formats

In .NET (and any other framework for that matter), it’s better to never assume anything, but to check twice. Let’s take an example – what do you think, will the following unit test always pass? . . . . . … Continue reading

Posted in .NET, C# | Tagged , , , | Leave a comment

On confusing error messages

This morning I stumbled upon a strange error message, while running a .NET console application: The application has failed to start because its side-by-side configuration is in correct. Please see the application event log or use the command-line sxstrace.e xe … Continue reading

Posted in .NET, C# | Tagged , , , | Leave a comment

ADO.NET connection resiliency

In a previous post I mentioned a new feature that was going to be added in .NET Framework 4.5.1: ‘ADO.NET connection resiliency’. Now that .NET 4.5.1 is RTM, I decided to check what exactly is this all about.I wrote a … Continue reading

Posted in .NET, C# | Tagged , , , | 2 Comments

Some multi-threading gotchas

Most programmers know that they must make their code thread-safe when accessing shared data from multiple threads at the same time. However, there are some cases which are not so obvious and which might cause very subtle bugs that appear … Continue reading

Posted in .NET, C# | Tagged , , | Leave a comment

Event aggregator in .NET

A few days ago I had to choose an event aggregator implementation for using it inside the project (ASP.NET in this case). Of course, there are plenty of alternatives, probably the most famous being the one from Prism . Since that … Continue reading

Posted in .NET, C# | Tagged , , , , , , , , | Leave a comment