Month: October 2014

foreach image in a resource file

Resource files are a very useful addition to the .NET framework as they allow easy storage and retrival of data e.g.

In order to iterate through the all the resources in the resource file, we have to use ResourceSet. To get it we need run a resource manager on our resource file. The complete

Continue Reading

How to display an image on the website from a binary source (e.g. a database)

There are various ways in which one could display an image on the website form a binary source. One solution would invole simply converting the binary source into a base64 and put it as the src of the image:

However, this is not acceptable if you load images 'on demand' i.e. when the user

Continue Reading

"The target application has been unloaded" - the annoying error

"The target application has been unloaded" is highlighted by Visual Studio, but doesn't actually do anything. Interestingly enough the error wasn't doing anything. It was just highlighted by Visual Studio and prevented the syntax highlighter as well as the code builder from working. After finding nothing on the internet I gave up and went home.

Continue Reading

Tracing of WCF services - code example

Tracing can be very beneficial especially when the application has already been deployed and we need to figure out why things do work. Useless errors of type HTTP 500 don't give any meaningful results, so I decided to use System.Diagnostics to help me track down the errors. Logging There are two important (and very simplifed

Continue Reading