ServiceStack v4.0.12

New Email Contact Services

A new ServiceStack guidance is available detailing the recommended setup and physical layout structure of typical medium-sized ServiceStack projects. It includes the complete documentation going through how to create the solution from scratch, and explains all the ServiceStack hidden features it makes use of along the way.

EmailContacts Screenshot

EmailContacts is a Single Page App built using just ServiceStack, jQuery and Bootstrap that showcases some of ServiceStack's built-in features, useful in the reducing the effort for developing medium-sized Web Applications.

The purpose of EmailContacts is to manage contacts (in any RDBMS), provide a form to be able to send them messages and maintain a rolling history of any emails sent. The application also provides an option to have emails instead sent and processed via Rabbit MQ.

Functional Single Page App in under 130 Lines of HTML and 70 Lines JS

The entire EmailContacts UI is maintained in a single default.cshtml requiring just 70 lines of JavaScript to render the dynamic UI, bind server validation errors and provide real-time UX feedback. The Application also follows an API-First development style where the Ajax UI calls only published APIs allowing all services to be immediately available, naturally, via an end-to-end typed API to Mobile and Desktop .NET clients.

Example Projects

During this release all Example projects, Demos, Starter Templates, etc in the ServiceStack.Example and ServiceStack.UseCases master repositories were upgraded to ServiceStack v4. A new ServiceStack + MVC5 project was also added to UseCases, it just follows the instructions at MVC Integration wiki, but starts with an empty MVC5 project.

Added new OrmLiteCacheClient

A new OrmLiteCacheClient Caching Provider was added to the ServiceStack.Server NuGet pacakge. This provides a lot of utility by supporting OrmLite's RDBMS providers allowing utilization of existing RDBMS's as a distributed cache, potentially saving an infrastructure dependency.

Registration is simply:

//Register OrmLite Db Factory if not already
container.Register<IDbConnectionFactory>(c => 
    new OrmLiteConnectionFactory(connString, SqlServerDialect.Provider)); 

container.RegisterAs<OrmLiteCacheClient, ICacheClient>();

//Create 'CacheEntry' RDBMS table if it doesn't exist already

Service Clients

  • Added CaptureSynchronizationContext option to get Async Service Clients to execute responses on the same SynchronizationContext as their call-site
  • Added UserAgent option, now defaults with the ServiceStack .NET client version

Minor features

  • Allow unrestricted access for Redis MQ and Rabbit MQ clients within free-quotas
  • SessionIds are no longer created with Url Unfriendly chars +, /
  • Add typed ToOneWayUrl() and ToReplyUrl() extension method for generating predefined urls
  • Add Test showing how to use ExecAllAndWait extension method to easily run synch operations in parallel
  • Added configurable BufferSize in StaticFileHandler
  • All CacheClients can now store AuthUserSessions when JsConfig.ExcludeTypeInfo=true
  • Allow RegistrationService to be used for PUT requests to updates User Registration info
  • Elmah Logger now takes in a HttpApplication so it can use ErrorSignal.Get(application).Raise(<exception>) allowing modules such as ErrorMail and ErrorPost (ElmahR) to be notified



  • Use enhanced functionality for when newer versions of redis-server exists
    • i.e. Use more precise EXPIRE operations when server supports it
  • Add GetServerTime()


  • Moved JsConfig.RegisterForAot() to PclExport.RegisterForAot()
    • Fine-grained AOT hints available on IosPclExport static methods in PCL builds

Breaking Changes

The ServiceStack.Stripe NuGet package is now a normal .NET 4.0 release. A new portable NuGet package was created for PCL clients at ServiceStack.Stripe.Pcl.