Category Archives: C#

Span in .NET, C# and other languages

By now probably most .NET developers have heard about the new Span classes, that will be added in the upcoming .NET and C# versions (C# 7.2 to be more precise). I won’t go into details about what it is and … Continue reading

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

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