Posts tagged C#


Unravelling TargetInvocationException

I use Moq for testing. This framework (along with others) uses Castle.Core to create it’s proxy instances. A problem you run into is trying to assert for specific exceptions thrown from the proxy’s constructor, as Castle likes to wrap these in a Reflection.TargetInvocationException. In order to get [...]

Automate GhostScript in C#

This example demonstrates how to send source to GhostScript on the stdin stream, and capture the result on the stdout stream. Test Program In this basic test example we start with a simple “Hello World” PostScript document, call the PostscriptToPdf function, and get the resulting PDF document in a [...]

Delimited Lists within Groups using Linq

WARNING: It turns out that although functional, this example does not scale well, performance is O(n²)… as the list size doubles, execution time quadruples… back to the drawing board! For detail read the Performance section at the bottom of the post. Given a basic set of values (in this case some [...]

Plugin Architecture with Configuration Support

For an upcoming project I want to make use of a simple plugin architecture. The application I’m working on processes data for several different clients. Each client will have different rules, and I’m aiming for a data processing plugin for each client. From a deployment perspective I want to load [...]

ServiceErrorLog Provider for ELMAH, Part 3

Pulling Things Together Finally, it’s time to flesh out the method stubs that I created in Part 1, so that the web services are called. I started by adding a Web Reference in the MyCompany.ElmahExt project to the LoggingService that I created in Part 2. First, I made the following additions to the [...]

ServiceErrorLog Provider for ELMAH, Part 2

Review In Part 1 I created a basic implementation for a new ELMAH logging provider that will provide indirect logging to SQL Server over a web service interface. Currently, the basic skeleton code is called, but it doesn’t do anything useful at the moment. Eventually, I need to fill in those [...]

ServiceErrorLog Provider for ELMAH, Part 1

Introduction I’m really interested in using Atif Aziz’s ELMAH (Error Logging Modules and Handlers for ASP.NET) in my next project. Up to now I’ve used the perennial favourite Log4Net, or rolled my own error logging implementation. Currently, all our web errors get emailed to our support team, and… [...]
Go to Top