Post is pinned.Post has attachment
v4.5.8 Released!

We've got a another feature-packed release with a number of exciting new features new support for the Open API specification enabling new integration possibilities with Azure API Management and Azure AutoRest, our real-time Server Events solution extending to new Mobile, Desktop and Server platforms, more flexible Authentication options to dramatically simplify integration with Mobile, Desktop and Web clients, effortless JWT Refresh Tokens, enhanced support for TypeScript and Java client libraries, new compression options, upgrades to the latest Fluent Validation with support for Async validators, Async Request Filters, a number of new quality OSS ServiceStack projects developed by the community and lots more use-case driven features and refinements across the entire ServiceStack suite!

Please see the v4.5.8 Release Notes for the full details:

For a quick summary we'll highlight the major features below:

Open API

We've added support for the Open API Specification which opens up several new integration possibilities including importing your Services into Azure API Management and generating native clients with Azure's AutoRest. The Open API plugin also embeds Swagger UI letting you quickly explore and interact with your services.

Server Events

We've made great strides in this release towards our goal of expanding the Server Event ecosystem in popular Mobile, Desktop and Server platforms with new first-class implementations for Android, Java and TypeScript which now includes:

- C# Server Events Client
- Xamarin.iOS
- Xamarin.Android
- .NET Framework 4.5+
- .NET Core (.NET Standard 1.3+)
- TypeScript Server Events Client
- Web
- Node.js Server
- React Native
- iOS
- Android
- Java Server Events Client
- Android
- JVM 1.7+ (Java, Kotlin, Scala, etc)
- Java Clients
- Java Servers
- JavaScript (jQuery plugin)
- Web

Android Java Chat

To showcase real-world usage of `AndroidServerEventsClient` in an Android App we've ported C# Xamarin Android Chat into Java 8 using Google's recommended Android Studio Development Environment:

In addition to retaining the same functionality as the original C# Xamarin.Android Chat App, it also leverages the native Facebook, Twitter and Google SDK's to enable seamless and persistent authentication when signing in with Facebook, Twitter or Google User accounts.

Web, Node.js and React Native ServerEvents Apps

The TypeScript servicestack-client npm package is a cross-platform library enabling a rich, productive end-to-end Typed development experience on Web, node.js Server projects, node.js test suites, React Native iOS and Android Mobile Apps - written in either TypeScript or plain JavaScript.

To help getting started using servicestack-client in each of JavaScript's most popular platforms we've developed a simple Server Events Web, Node.js and React Native Mobile iOS App that can connect to any Server Events Server and listen to messages published on the subscribed channel. The App also maintains a live synchronized list of Users in the channel that's automatically updated whenever Users join or leave the channel:

Each App uses the optimal starting configuration that enables a productive workflow on each platform and uses the minimum runtime dependencies - essentially just servicestack-clientand its es6-shim and W3C `EventSource` polyfills on Node.js and React Native where it's missing a native implementation.

TypeScript servicestack-client improvements

New APIs have been added to TypeScript's servicestack-client to catch up with the additional flexibility and features available in C#/.NET Service Clients:

Sending additional arguments with Typed API Requests

Many AutoQuery Services utilize implicit conventions to query fields that aren't explicitly defined on AutoQuery Request DTOs, these can now be queried by specifying additional arguments with the typed Request DTO, e.g:

const request = new FindTechStacks();

client.get(request, { VendorName: "ServiceStack" })
.then(r => { }) // typed to QueryResponse<TechnologyStack>

Calling APIs with Custom URLs

In addition to Typed API Requests you can now also call Services using relative or absolute urls, e.g:



// GET
client.get<GetTechnologyResponse>("/technology", { Slug: "ServiceStack" })

Relaxed TypeScript Definitions

The metadata requirements in TypeScript Ambient Interface definitions generated by Add ServiceStack Reference's `/types/typescript.d` have been relaxed so they can be used to Type Object Literals:

let request:QueryContracts = { accountId: 1234 };

Authentication via OAuth AccessTokens

To improve OAuth Sign In integration from native Mobile or Desktop Apps we've added support for direct Authentication via AccessTokens which can dramatically simplify the Development and User Experience by being able to leverage the Native Facebook, Twitter and Google Client SDK's to Sign In users locally then reuse their local AccessToken to Authenticate with back-end ServiceStack Servers.

This feature is what's used to enable Integrated Facebook, Twitter and Google Logins in Android Java Chat and be able to Automatically Sign In users with saved AccessTokens.

This capability is now available on the popular OAuth Providers below:

- `FacebookAuthProvider` - Sign in with Facebook
- `TwitterAuthProvider` - Sign in with Twitter
- `GithubAuthProvider` - Sign in with Github
- `GoogleOAuth2Provider` - Sign in with Google

Client Authentication with AccessToken

Clients can utilize this feature with the new `AccessToken` and `AccessTokenSecret` properties on the existing `Authenticate` request DTO, sent with the provider that the AccessToken is for, e.g:

var response = client.Post(new Authenticate {
provider = "facebook",
AccessToken = facebookAccessToken,
RememberMe = true,

JWT Refresh Tokens

Support for Refresh Tokens is now available in the JWT Auth Provider where new JWT Tokens can now be generated from a longer-lived `RefreshToken` which can be used to fetch new JWT Tokens without needing to re-authenticate with a separate Auth Provider.

Accessing Refresh Tokens

Just like JWT Tokens, Refresh Tokens are populated on the `AuthenticateResponse` DTO after successfully authenticating via any registered Auth Provider, e.g:

var response = client.Post(new Authenticate {
provider = "credentials",
UserName = userName,
Password = password,

var jwtToken = response.BearerToken;
var refreshToken = response.RefreshToken;

Lifetimes of tokens

The default expiry time of JWT and Refresh Tokens below can be overridden when registering the `JwtAuthProvider`:

new JwtAuthProvider {
ExpireTokensIn = TimeSpan.FromDays(14), // JWT Token Expiry
ExpireRefreshTokensIn = TimeSpan.FromDays(365), // Refresh Token Expiry

Using JWT and Refresh Tokens

In order to provide the simplest development experience possible you only need to specify the Refresh Token on the Service Client and it will take care of transparently fetching a new JWT Token behind-the-scenes. You don't even need to configure the client with a JWT Token as it will just fetch a new one on first use, e.g:

var client = new JsonServiceClient(baseUrl) {
RefreshToken = refreshToken,

var response = client.Send(new Secured());

Fluent Validation Upgraded

Another major feature added in this release was contributed by the community with +Scott Mackay upgrading our internal Fluent Validation implementation to the latest version of FluentValidation. Special care was taken to maintain backwards compatibility where ServiceStack enhancements were retrofitted on top of the new version and existing Error Codes were preserved to ensure minimal disruption with existing code bases.

### Async Validators

One of the benefits from using the latest version of Fluent Validation is we now have support for Async Validators! Async validators can be registered using the `MustAsync` validator where you could simulate the following built-in Not Empty validation:

public class MyRequestValidator : AbstractValidator<MyRequest>
public MyRequestValidator()
RuleFor(x => x.Name).NotEmpty();

And replace it with an Async version that uses the Service Gateway to call a custom Async `GetStringLength` Service that returns the same `ErrorCode` and Error Message as the Not Empty validator:

public class MyRequestValidator : AbstractValidator<MyRequest>
public MyRequestValidator()
RuleFor(x => x.Name).MustAsync(async (s, token) =>
(await Gateway.SendAsync(new GetStringLength { Value = s })).Result > 0)
.WithMessage("'Name' should not be empty.")

Async Global Request Filters

To properly implement Async Validators we also needed Async Request Filters which were also added in this release where you can now register non-blocking Request Filters with:

GlobalRequestFiltersAsync.Add(async (req,res,dto) => {
var response = await client.Send(new CheckRateLimit {
Service = dto.GetType().Name,
IpAddress = req.UserHostAddress,
if (response.RateLimitExceeded)
res.StatusCode = 403;
res.StatusDescription = "RateLimitExceeded";

Enhanced Compression Options

We've followed up Request Compression added in the last release with more compression features in this release including:

[CompressResponse] Attribute

You can now selectively choose which Services should be compressed with the new `[CompressResponse]` attribute to compress responses for clients which support compression, which can be applied to most Response Types, e.g:

public class CompressedServices : Service
public object Any(CompressDto request) => new CompressExamplesResponse();
public object Any(CompressString request) => "foo";
public object Any(CompressBytes request) => "foo".ToUtf8Bytes();
public object Any(CompressStream request) => new MemoryStream("foo".ToUtf8Bytes());
public object Any(CompressFile request) => new HttpResult(VirtualFileSources.GetFile("/foo"));

public object Any(CompressAnyHttpResult request)
return new HttpResult(new CompressExamplesResponse()); // DTO
return new HttpResult("foo", "text/plain"); // string
return new HttpResult("foo".ToUtf8Bytes(), "text/plain"); // bytes

> Note using `[CompressResponse]` is unnecessary when returning cached responses as ServiceStack automatically caches and returns the most optimal Response - typically compressed bytes for clients that supports compression

Static File Compression

ServiceStack can also be configured to compress static files with specific file extensions that are larger than specific size with the new opt-in Config options below:

SetConfig(new HostConfig {
CompressFilesWithExtensions = { "js", "css" },
// (optional), only compress .js or .css files > 10k
CompressFilesLargerThanBytes = 10 * 1024

When more fine-grained logic is needed you can override `ShouldCompressFile()` in your AppHost to choose which static files you want to compress on a per-file basis, e.g:

public override bool ShouldCompressFile(IVirtualFile file)
return base.ShouldCompressFile(file) || file.Name == "large.csv";


We've been lucky to receive a number of quality contributions from the Community in this release starting with the new Serilog Logging provider contributed by +Josh Engler:


To Configure Serilog Logging, first download ServiceStack.Logging.Serilog from NuGet:

PM> Install-Package ServiceStack.Logging.Serilog

Then configure ServiceStack to use `SerilogFactory`:

LogManager.LogFactory = new SerilogFactory();

Community Projects

There's also been a number of quality OSS Community projects that's surfaced recently that you may find useful to enable in your ServiceStack projects:


If you need to implement a Webhooks solution for your Services you'll definitely want to check out ServiceStack.Webhooks +Jezz Santos. ServiceStack.Webhooks is a high-quality, actively developed, well documented solution for raising and managing application-level "events" raised by your services:


is a fork of ServiceStack.Authentication.Aad developed by +Ian Kulmatycki which provides an `AzureAuthenticationProvider` for easily authenticating users with Office365 and hybrid Azure Active Directories:


is a `UserAuthRepository` repository developed by +Michal Gajek for persisting users in Marten - a Document Database for PostgreSQL.


Another feature contributed by +Josh Engler is the `MultiAppSettingsBuilder` which adds a fluent discoverable API for configuring ServiceStack's various App Setting Providers, e.g:

AppSettings = new MultiAppSettingsBuilder()
.AddDictionarySettings(new Dictionary<string,string> { "override" : "setting" })

CacheClient with Prefix

The `CacheClientWithPrefix` class contributed by +Joël Harkes lets you decorate any `ICacheClient` to prefix all cache keys using the `.WithPrefix()` extension method. This could be used to easily enable multi-tenant usage of a single redis instance, e.g:

container.Register(c =>

OrmLite Soft Deletes

Select Filters were added to OrmLite to let you specify a custom `SelectFilter` that lets you modify queries
that use `SqlExpression<T>` before they're executed. This could be used to make working with "Soft Deletes"
Tables easier where it can be made to apply a custom `x.IsDeleted != true` condition on every `SqlExpression`.

By either using a `SelectFilter` on concrete POCO Table Types, e.g:

SqlExpression<Table1>.SelectFilter = q => q.Where(x => x.IsDeleted != true);
SqlExpression<Table2>.SelectFilter = q => q.Where(x => x.IsDeleted != true);

Or alternatively you can configure a global `SqlExpressionSelectFilter` with:

OrmLiteConfig.SqlExpressionSelectFilter = q =>
if (q.ModelDef.ModelType.HasInterface(typeof(ISoftDelete)))
q.Where<ISoftDelete>(x => x.IsDeleted != true);

Both solutions above will transparently add the `x.IsDeleted != true` to all `SqlExpression<T>` based queries so it only returns results which aren't `IsDeleted` from any of queries below:

var results = db.Select(db.From<Table>());
var result = db.Single(db.From<Table>().Where(x => x.Name == "foo"));
var result = db.Single(x => x.Name == "foo");


You can easily escape HTML Entities characters (`<`, `>`, `&`, `=`, `'`) when serializing JSON strings with:

JsConfig.EscapeHtmlChars = true;

This can also be requested by clients using Customized JSON Responses, e.g:


Rabbit MQ

A strong-named version of ServiceStack.RabbitMq is now available at:

PM> Install-Package ServiceStack.RabbitMq.Signed

The new `CreateQueueFilter` and `CreateTopicFilter` filters added to the Rabbit MQ Server will let you customize what options Rabbit MQ Queue's and topics are created with.

Startup Errors

To better highlight the presence of Startup Errors we're now adding a red warning banner in `/metadata` pages when in DebugMode.
The number of Startup Errors is also added to the `X-Startup-Errors: n` Global HTTP Header so you'll be able to notice it when debugging HTTP Traffic.

Forcing a Content Type

Whilst ServiceStack Services are typically available on any endpoint and format, there are times when you only want adhoc Services available in a particular format, for instance you may only want the View Models for your dynamic Web Views available in HTML. This can now be easily enabled with the new `[HtmlOnly]` Request Filter Attribute, e.g:

public class HtmlServices : Service
public object Any(MyRequest request) => new MyViewModel { .. };

This feature is also available for other built-in Content Types: `[JsonOnly]`, `[XmlOnly]`, `[JsvOnly]` and `[CsvOnly]`.

AuthProvider available on IAuthSession

You can now determine what Auth Provider was used to populate a User's Session with the new `IAuthSession.AuthProvider` property. This could be used for instance to detect and ensure highly-sensitive services are only available to users that authenticated using a specific Auth Provider.

All .NET Core Examples upgraded to .NET Core 1.1

All .NET Core Live examples including the redis-geo project used in Deploy .NET Core with Docker to AWS ECS Guide were upgraded to .NET Core 1.1 and has been changed to use the `microsoft/dotnet:1.1-sdk-projectjson` Docker Image since `microsoft/dotnet:latest` was changed to only support projects with VS 2017 `.csproj` msbuild format.

This covers a high-level view of the major features added in this release, please see the v4.5.8 Release Notes for the full details and other features added in this release:

- Enjoy!

Hi guys,

I need to run my application inside a docker container and access an Oracle database.

Mainly, I'd like to use mono or .net core, does anyone know if this is possible? Is there any guidelines for doing this?


Where i can find ServiceStack road map for next .net frameworks?
Now that Microsoft roll out .net Core... How ServiceStack fit in?  

 I have a situation where I work for two companies. Under the first one I am a v4 developer who has paid for ServiceStack appropriately (Company A). I'm also a developer for a separate company  (Company B) where they use v3. Unfortunately at this time Company B won't upgrade to v4 but they want to implement a Windows Auth Provider.  Is there anyway for Company B to pay for use of the Windows Auth Provider in v3 (without any support of course) ?

Today I had to work on a project for a client and due to restrictions out of my control, that project had to be ASP.NET MVC 5. Today I was reminded what a ball of mess that world is.

There's no definitive answer on how to use Ninject with MVC and WebAPI (err, 2 frameworks in one right there), DLL versioning nightmares where MVC 4 still creeps in and bin deploy craziness that's not documented anywhere.

So, ServiceStack people, thank you. Thank you for doing what you're doing.

Post has attachment
v4.0.36 Released!

Xamarin Unified API
It's another short release cycle this time around as we wanted to ship the ServiceClients new support of Xamarin Unified API to Xamarin developers as soon as possible.

Add ServiceStack Reference meets Xamarin Studio
In this release we've also released our initial ServiceStackXS Add-In for Xamarin which provides Add ServiceStack Reference support to Xamarin Studio! This should improve the development experience for Mobile App Developers building Apps with Xamarin Studio to Consume your Services.

There's a new Sitemap plugin that makes it easy to generate dynamic Sitemap of your website routes to help Search Engines into properly indexing your website

TechStacks LiveDemo Features
I've also gone through some of the features added in LiveDemo that may be useful to know. Which shows how to generate multiple versions of your Website and code required to make Twitter Status updates from your website (and other Twitter Authorized API requests).

There's a couple of other minor features, check the release notes for all the details:


Post has attachment
v4.0.33 Released!

We have a few exciting announcements in this release, the major ones include:

*OrmLite now supports Async!*

Currently only RDBMS .NET providers that offer Async API's is .NET 4.5 version of Sql Server and MySql, we'll add support for more RDBMS's as they become available in the underlying ADO.NET provider

*ServiceStack.Redis now supports SSL!*

This means you can now connect directly to Azure Redis Cache sercure connection, more info at:

*New VB.NET Add ServiceStack Reference*

Add ServiceStack Reference now support all major .NET C#, F# and VB.NET languages. This release also includes a simplified UX around a single source file approach.

*Other Features*
We've also added enhanced connection strings for the Redis Client, which allows us to add a new streamlined RedisManagerPool. There's a new Custom API that lets you create and call adhoc redis-server API's.

New JsConfig<T>.OnDeserializing and dynamic ShouldSerialize(string field) customization options in ServiceStack.Text

New `PublishMessageFilter` and `GetMessageFilter` callbacks for intercepting outgoing and incoming messages in RabbitMQ Client/Server.

And more minor features, for more details checkout the release notes:



Are there any whitepapers or publications that take a deep dive into MQ and SS? I've been staring at samples from the unit tests and am more lost then ever on how to design a functioning message system.

Thank you 

Post has attachment
v4.0.31 Released!

This ended up being a pretty big release with a bunch of new features making it in this round. I'm happy to report that we've answered the calls for a Redis ServerEvents back-end for using Server Events in a scale-out/load-balanced environment. We've also added a typed and feature-rich C# Server Events Client, the release notes contains a lot more detail on each.

Other features include:

 - Chat.exe - There's a portable, cross-platform version of Chat compiled into a single .exe that supports both Memory and Redis Server Events and can run on Windows or OSX
 - Redis Pub/Sub Server - Provide a managed Pub/Sub connection for processing Redis Pub/Sub messages
- AppSettings - AppSettings is now a First-class concept that can be easily accessed throughout ServiceStack. It also supports a writable API
 - Metadata Pages - Many Swagger Annotations are now displayed on the metadata operations page
 - WebSudo - We have a new Authentication feature called WebSudo
 - Auth Events - We've added a new pluggable API to tap into Auth Events
 - OrmLite - A couple new API's added + upgraded ADO.NET providers for PostgreSQL and Sqlite
 - ServiceStack MiniProfiler Toolkit - I've also added some details about +Michał Gajek's new ServiceStack MiniProfilingToolkit and the rich introspection it enables.

There's a lot more details in the release notes to checkout when you find the time:


Post has attachment
New ServiceStack LiveDemos!

To better discover ServiceStack example apps and demo's we've moved them to a new GitHub group. All Demos have also been upgraded to the latest v4 release and have them all deployed to a new Single Amazon instance. This also makes it a lot easier to fork, customize and 1-click WebDeploy any changes to your own Windows Servers.

There's a list with screenshots and summaries of all the hosted Live Demos at:

E.g. Checkout our new ServerEvents Chat app at - I'll be hanging out in there myself all day if anyone wants to ask me anything.
Wait while more posts are being loaded