bmancini's blog

Dec 17 2009

Checking assembly dependencies for .NET

Are you getting the dreaded "Could not load file or assembly" error in C#? Well there might be several causes of that, the most difficult to track down and fix is a missing assembly dependency.

Nov 07 2009

reCAPTCHA for ASP.NET MVC that uses ModelState

Here is a reCAPTCHA control for ASP.NET MVC that uses ModelState. This code includes the ActionFilter as well as the HTML Helper for rendering the reCAPTCHA control.

Oct 17 2009

Adding a container to ValidationSummary helper in ASP.NET MVC

The one thing that is annoying about the validation summary HTML Helper in ASP.NET MVC is that it doesn't render a container element. Problem solved...

Oct 09 2009

Generic XML Serialization Class

We had to add XML Serialization functionality to a bunch of different classes. Here is a nice generic class for adding static methods for Serialization and Deserialization to any of your classes...

Oct 07 2009

Re-throwing Exceptions in C# with InternalPreserveStackTrace

It is often the case that you need to re-throw an exception after handling it. The common problem with re-throwing exceptions is that you often lose stack trace information that can be extraordinarily useful for debugging purposes. I'll explain a technique that can be used to force the entire stack to be propagated when an exception is re-thrown.

Sep 23 2009

Solving xsd generation error: 'The element .... is missing'

In attempting to build source from an XML schema using the XSD command line tool, I kept getting an error about an element missing.

Sep 21 2009

Enum DropDownList in ASP.NET MVC

I created an HTML Helper for rendering a dropdownlist aka select element from the name/value pairs in an enum and thought I would share.

Sep 11 2009

Use GMail with Rails ActionMailer

Sending ActionMailer emails through GMail is much easier now that Ruby on Rails natively supports TLS connections.

Aug 31 2009

Null strings in ASP.NET MVC 1.0 with DataAnnotations

After getting DataAnnotations working with ASP.NET MVC 1.0, I noticed a strange anomaly. Values that were previously bound as empty strings were now being bound as null values.

Aug 31 2009

DataAnnotations in ASP.NET MVC 1.0

DataAnnotations is the Microsoft way of declaratively adding validation rules to a model. You simply add an attribute to a property and voila, it has validation! The concept of DataAnnotations should be familiar to anyone who has worked in Ruby on Rails and added validation rules inside the ActiveRecord model. I'm going to go over some of my findings and walk you through using DataAnnotations. Hopefully my pain, will be your gain.

Recent comments