Project Description
SpecExpress is a fluent validation framework and container for .Net that makes it easier to write validation rules and validate your objects. SpecExpress also offers integration with ASP.NET WebForms, eliminating duplication of your validation rules.

Supported By


Source Code moved to GitHub!

We may explore mirroring it here in the future, but for now consider the Source Code stored here on CodePlex an archive.

SpecExpress is now available to be referenced in your project through NuGet packages.

News and update information can be found at:


  • The SpecExpress DSL provides developers with a Fluent Interface for quickly composing rules that are also easy to read. See a Sample
  • Generates error message from your validation rules, but allows for easy overriding and customization of individual messages. Support for localization of error messages.
  • Validation Catalog allows:
    • Auto discovery of specifications means the developer isn't required to resolve which validation rules to use
    • Programatically add or change validation rules at runtime
    • Validation Contexts
  • Support for rich, complex object types and graphs
  • Built with extension and customization in mind
  • Easy to integrate into your existing code because there are no Base Classes or Attributes to inject into your code
  • ASP.NET WebForms support
  • ASP.NET MVC support
  • Silverlight support
  • A rich set of Validators


SpecExpress takes a different approach than most other Validation Frameworks, such as Validation Application Block. SpecExpress doesn't use Attributes to decorate properties and embed all the metadata required for the rule. Instead, it it uses a separate class, called a Specification, which contains a set a rules for all the properties for a type. This allows for much easier reading, separation of concerns, and much better support for state based validation.


public class AddressSpecification : Validates<Address>
    public AddressSpecification()
        Check(a => a.Street1).Required().And.IsAlpha().And.MaxLength(255);
	Check(a => a.Street2).Optional().And.IsAlpha().And.MaxLength(255);
	Check(a => a.City).Required().And.IsAlpha().And.MaxLength(50);

	Check(a => a.State)
            .If(a => a.Country == "US").Required()

	Check(a => a.Country).Optional().And.IsAlpha();

	Check(a => a.ZipCode)
	    .If(a => a.Country == "US").Required()

	Check(a => a.ZipPlusFour)
	   .If(a => a.ZipCode.Any()).Required()


Getting Started

Check out the Quick Start or Developers Guide.


SpecExpress requires Microsoft .Net 4.0.

Additional Resources


Click here to view the RSS feed.


  • Localization of error messages

Last edited Apr 10, 2013 at 7:31 PM by rbell80134, version 53