Saving thumbnails in the original file format with C#

I tripped up on a strange quirk working with the Image and ImageFormat classes recently. The intention was simple – load an Image object from an existing graphic, generate a thumbnail, and save it out in the original format. The Image class in .NET includes a handy “RawFormat” property indicating the correct format to save out in. So far, so… Read more “Saving thumbnails in the original file format with C#”

Posting to Facebook Page using C# SDK from offline app

If you want to post to a facebook page using the Facebook Graph API and the Facebook C# SDK, from an “offline” app, there’s a few steps you should be aware of. First, you need to get an access token that your windows service or app can permanently use. You can get this by visiting the following url (all on… Read more “Posting to Facebook Page using C# SDK from offline app”

Applying app.config transformations (in the same way as web.config)

Visual Studio 2010 doesn’t have the same support for app.config files in the way that their web projects do, in order to vary connection strings and other configuration settings for different release modes – a real shame. You can vote on the issue here. In the meantime though, the ASP.NET team have a fix, detailed here. All you need to… Read more “Applying app.config transformations (in the same way as web.config)”

Gotcha: “The specified metadata path is not valid.” with ADO.NET Entities on Vista x64

For those of you foolhardy enough to be running Vista x64 (myself included!), VS 2008, and the latest build of the ADO.NET Entities framework… you may well hit the following error message: The specified metadata path is not valid. A valid path must be either an existing directory, an existing file with extension ‘.csdl’, ‘.ssdl’, or ‘.msl’, or a URI that… Read more “Gotcha: “The specified metadata path is not valid.” with ADO.NET Entities on Vista x64”

C#/VB.NET Code Translation tweak

I’ve been getting a *lot* of feedback recently over the changes we made to the C#/VB.NET code translation tools to try and tidy them up – but unfortunately broke a somewhat crucial ability to copy the code out in IE6! I’m still not sure why IE6 is so unhappy with the CSS and is preventing any sensible selection in the… Read more “C#/VB.NET Code Translation tweak”

C# <-> VB.NET Converters Updated

We’ve just updated our free C# to VB.NET and VB.NET to C# converters on Developer Fusion – they’re adapted from the neat little utilities within the free .NET IDE, #develop . They now keep your comments in tact too. Great for when you’ve found those bits of sample code in the wrong language! If you haven’t come across them before, they’re well… Read more “C# <-> VB.NET Converters Updated”

Dynamically Generating PDFs in .NET

It's perfectly possible to generate a PDF from scratch, using a library such as iTextSharp, a port of a free Java PDF library. However, it can be hard work defining all the code you need to generate the layout you're after, and impossible for someone to tweak the layout without going back to the developer. One alternative, using the same… Read more “Dynamically Generating PDFs in .NET”

*New* UK Windows Forms Mailing List

After some discussion over at the MsWebDev mailing list, I’ve now decided to launch an equivalent list for UK developers that want to discuss Windows Forms related and other .NET topics. For more information, go to Eventually we hope to offer NNTP and searchable Forum access to this courtesy of Community Server too. Please spread the word!

Converting VB.NET code to C# (and back again) – V2

I’ve just updated the VB.NET -> C# and C# -> VB.NET code converter on Developer Fusion – a large number of bugs have now been squished! Check them out at The utility uses the conversion code from the #develop IDE, and any bugs we come across I’ll be fixing and integrating into the #develop code too. Let me know… Read more “Converting VB.NET code to C# (and back again) – V2”

Customize XML Serialization using IXmlSerializable

XML Serialization in .NET provides an incredibly useful (and easy) way to turn objects into XML and back again. However, in some situations, you may need more control over how your object is serialized. Recently, I found myself needing to serialize an object that contained a number of property name/values – stored using a NameValueCollection. However, you can’t serialize this… Read more “Customize XML Serialization using IXmlSerializable”

Automatically convert VB.NET code to C#

I’ve just launched another utility on Developer Fusion – this time, a converter from VB.NET to C#. This is the only VB.NET to C# converter that I’m aware of which is currently online. The code is very much a work-in-progress. As with the C# to VB.NET converter, the code is based on the great work of the #develop team. I’m… Read more “Automatically convert VB.NET code to C#”

Automatically Convert C# code to VB.NET

I’ve just put up the first (of many) planned utilities on Developer Fusion – a conversion tool for automatically translating C# code into its VB.NET equivalent. Feel free to take a look, and let me know if you find any problems. The credit is 99.99% due to the guys behind #develop. I’ve simply made this tiny bit of their great application… Read more “Automatically Convert C# code to VB.NET”