Advanced bindings with the Windows Azure Web Jobs SDK

 Jan 27th, 2014 

The Windows Azure Web Jobs SDK is a framework that simplifies the task of adding background processing to web sites. You can get more details about it by reading the Getting Started guide or Scott Hanselman’s introduction. Scott describes the Web Jobs SDK very well: “minimal ceremony for maximum results”. The Windows Azure Web Jobs […]

Continue reading »

C# error CS1540

 Sep 12th, 2012 

There are many ways in which one could violate the rules of Object Oriented Programming in C#. Fortunately, the C# compiler is smart enough to prevent many of them, like the one in the example below. Can you  figure out why the compiler doesn’t allow the call in the last method?

Continue reading »

Default indexer and Reflection glitch

 Apr 22nd, 2011 

I was writing some C# unit tests that had to use Reflection in order to set properties on objects, when I got into an interesting problem. I will provide a simplified version of the code I wrote, first the version without reflection, then my reflection version that had an issue and, in the end, the […]

Continue reading »

Dynamic tests with mstest and T4

 Mar 5th, 2011 

If you used mstest and NUnit you might be aware of the fact that the former doesn’t support dynamic, data driven test cases. For example, the following scenario cannot be achieved with the out-of-box mstest: given a dataset, create distinct test cases for each entry in it, using a predefined generic test case. The best […]

Continue reading »

Modifying .NET binaries – Part 2

 Jul 21st, 2010 

Description Objective Remove the ‘Trial protection’ from an obfuscated .NET application Tools WinDbg CFF Explorer Target audience Advanced users The second part of the article discusses how to modify binaries that are obfuscated. For simplicity and clarity, I will not use obfuscated binaries. Doing this, allows the reader to understand what is actually happening. In […]

Continue reading »

Modifying .NET binaries – Part 1

 May 30th, 2010 

The content of this post can be used for good and bad purposes. Modifying the source code to bypass trial/license checks is what crackers do in order to get paid software for free. Be advised that the purpose of this article is not to teach you how to steal. My target for this article are […]

Continue reading »

Expression evaluation

 May 27th, 2010 

Let’s start with a simple quiz: 7/2 = … . Of course is 3.5 but is this also true for code? If you somehow use a non-fractional data type for storing the result, you will always get the result 3. And that should not surprise you. However, if you choose to use a fractional data […]

Continue reading »

Fancy windows previewer

 May 5th, 2010 

Tutorial description Objective Create a fancy-looking application that displays the preview of the open applications. Covered topics Enumerating windows and getting various information about them Creating the Aero glass effect Using the DWM windows preview feature Requirements Windows Vista/7 with the Aero theme active Visual Studio 2010 (or 2008 but requires some changes in code […]

Continue reading »

Using UAC with C# – Part 3

 Jan 6th, 2010 

After a long period since I wrote part 2 of this article I decided to add some extra information. There is one thing that was missed by the previous two articles: the design of UAC enabled applications. If you use Windows Vista/7 then you know that buttons and links which elevate privileges are preceded by […]

Continue reading »

Tip 2: #if

 Jul 23rd, 2009 

This is a C# tip When the C# compiler encounters an #if directive, followed eventually by an #endif directive, it will compile the code between the directives only if the specified symbol is defined. Unlike C and C++, you cannot assign a numeric value to a symbol; the #if statement in C# is Boolean and […]

Continue reading »