Add ServiceStack to your project to get started

ServiceStack is an easy drop-in that simplifies creating Web Services in any ASP.NET Web App, but also in Self Hosting Console Apps, Windows Services and even Windows and OSX Desktop Apps - supporting both .NET Framework and .NET Core. The easiest way to get started is to create a new project from a ServiceStack VS.NET Template.

These packages include the Free Usage Quotas listed below. The list of supported packages are also listed on Dedicated support for these packages is available for Windows, Linux and OSX on .NET Core or Windows only for .NET Framework.

Just ServiceStack

The minimal installation of ServiceStack, create an Empty ASP.NET project and:

PM> Install-Package ServiceStack


  • ServiceStack.Common
  • ServiceStack.Client

The docs on Creating your first web service using ServiceStack's VS.NET Templates are an easy way to Get Started with ServiceStack.

Once comfortable with creating a ServiceStack web service, we also recommend exploring ServiceStack by walking through the EmailContacts solution for a guidance on the recommended layout and configuration of a typical medium-sized ServiceStack project.

ServiceStack with OrmLite, Redis and adapters

Would like to use Redis and/or OrmLite, create an Empty ASP.NET project and:

PM> Install-Package ServiceStack.Server


  • ServiceStack
  • ServiceStack.Redis
  • ServiceStack.OrmLite

Server project includes Auto Query, the OrmLite Auth Repository and Redis MQ

Add ServiceStack with advanced HTML Support

If you plan on using ServiceStack to create HTML websites as well then you should instead start with one of these 2 packages below:

ServiceStack with Razor Support

You want to use ServiceStack's built-in support for Razor, Create an Empty ASP.NET Project and:

PM> Install-Package ServiceStack.Razor


  • ServiceStack

We recommend reading the Razor Rockstars website to explore ServiceStack's Razor features.

ServiceStack together with ASP.NET MVC

You want to use ServiceStack together with an ASP.NET MVC Website, Create an Empty ASP.NET MVC Project and:

PM> Install-Package ServiceStack.Mvc


  • ServiceStack

After it's added to your MVC Project you'll need to follow the guidelines in MVC Integration and ensure ServiceStack is properly integrated.

Using Redis or OrmLite?

If you've started with ServiceStack.Server you already have OrmLite and Redis, if not you can add them individually:

Redis Client

Redis is a popular and indispensable tool in creating high-performance systems. It's often used as a cache, but as it supports comp-sci collections, Pub/Sub, Transactions and server-side LUA scripting, it's finding more use-cases every day.

PM> Install-Package ServiceStack.Redis


  • ServiceStack.Common

Running Redis on Windows

See the Download and installation instructions for the 2 most popular ways of running redis on windows.


OrmLite is a fast, simple, convention-based, config-free lightweight ORM that uses code-first POCO classes and Annotation attributes to infer and generate RDBMS table schemas. It's simply provides extension methods over ADO.NET's IDbConnection so is highly-flexible and can even be easily used seamlessly with other Micro ORM's like that uses extension methods like Dapper.

OrmLite has packages for all major RDBMS's, and you just need to install the package for the one you're using, which typically for .NET will be SQL Server:

PM> Install-Package ServiceStack.OrmLite.SqlServer


  • ServiceStack.Common

Otherwise if you're using an alternative database, install the one you need:

Just ServiceStack.Text?

JSON, JSV, CSV Serializers

ServiceStack.Text is a high-performance dependency-free library that contains all of ServiceStack's text processing, automapping utilities.
It includes 100's of enhancements to .NET's built-in String, Stream, Bytes, List, Dictionary, Reflection, Task and WebRequest types.

You will only need to install this when using on its own as ServiceStack.Text is already a dependency on all other ServiceStack NuGet packages.

PM> Install-Package ServiceStack.Text

Android, iOS, Windows Store, WPF and Silverlight clients should install the ServiceStack.Client package:

PM> Install-Package ServiceStack.Client


Message Queue Servers

ServiceStack's message-based design enables it to host Services on a variety of different transports including a number of different MQ Servers via the Messaging API all MQ Servers implement making it trivial to swap between different MQ Brokers.

Rabbit MQ

Rabbit MQ is a popular industrial strength open source implementation of the AMQP messaging protocol for communicating with MQ middleware on all major OS's.

PM> Install-Package ServiceStack.RabbitMq

Running RabbitMQ on Windows

See the installation and getting started guide for a walkthrough on setting up Rabbit MQ on windows and accessing it from C#.

ServiceStack Rabbit MQ

See ServiceStack's Rabbit MQ docs for an explanation on how Rabbit MQ works with ServiceStack and details on its message workflow.

Redis MQ

If Redis is already apart of your infrastructure, Redis MQ is an attractive choice to use as an MQ Broker without needing to add any additional infrastructure dependencies.

PM> Install-Package ServiceStack.Server


Amazon SQS

If you're hosted on AWS you can take advantage Amazon's reliable, scalable, fully managed message queuing service. SQS makes it simple and cost-effective to decouple the components of a cloud application. You can use SQS to transmit any volume of data, at any level of throughput, without losing messages or requiring other services to be always available.

PM> Install-Package ServiceStack.Aws

Azure Service Bus

If you're hosted on Azure you can utilize Azure Service Bus's highly-reliable and managed cloud messaging service or Windows Service Bus if running Service Bus on Windows Server.

PM> Install-Package ServiceStack.Azure

In Memory MQ

ServiceStack.Server also includes an In Memory MQ option useful for testing and for when other MQ Broker options are not available. Although not being able to accept network requests limits its usefulness.

Amazon Web Services

You can participate in AWS's vibrant ecosystem with ServiceStack's first-class support and deep integration with AWS that seamlessly integrates with popular back-end AWS technologies allowing hosting of ServiceStack solutions entirely on the managed AWS platform


All of ServiceStack's support for AWS is encapsulated within the single ServiceStack.Aws NuGet package:

PM> Install-Package ServiceStack.Aws


  • ServiceStack
  • AWSSDK.Core
  • AWSSDK.DynamoDBv2
The ServiceStack.Aws NuGet package includes implementations for the following ServiceStack providers:
Microsoft Azure


All of ServiceStack's support for Azure is encapsulated within the single ServiceStack.Azure NuGet package:

PM> Install-Package ServiceStack.Azure

ServiceStack.Azure includes implementation of the following ServiceStack providers:

Open Id and OAuth2

ServiceStack already comes in-built with a number of Authentication providers out of the box. Additional Open Id and OAuth2 providers that require a dependency on DotNetOpenAuth are available to install separately:

Open Id

The Open Id package includes support for Google, Yahoo and My Open Id as well as a generic provider that lets you authenticate with any Open Id provider:

PM> Install-Package ServiceStack.Authentication.OpenId


  • ServiceStack
  • DotNetOpenAuth.Ultimate


The OAuth2 package lets you authenticated with Google OAuth2 and LinkedIn OAuth2:

PM> Install-Package ServiceStack.Authentication.OAuth2


  • ServiceStack
  • DotNetOpenAuth.Ultimate

The Social Bootstrap Api is a good showcase showing how to enable all authentication providers within a single project.

User Auth Repositories

ServiceStack allows you to persist your User Auth information in a variety of different back-end persistence providers. Redis and InMemory are built-in to ServiceStack whilst ServiceStack.Server includes the OrmLite Auth Repository letting you store Users Authentication information in any of the RDBMS's that OrmLite supports: Sql Server, Sqlite, MySql and PostgreSQL.

In addition to these options you can also persist UserAuth info in RavenDB:

PM> Install-Package ServiceStack.Authentication.RavenDB


  • ServiceStack
  • RavenDB.Client

Mongo DB:

PM> Install-Package ServiceStack.Authentication.MongoDB


  • ServiceStack
  • mongocsharpdriver

or NHibernate:

PM> Install-Package ServiceStack.Authentication.NHibernate


  • ServiceStack
  • Iesi.Collections
  • NHibernate
  • FluentNHibernate
Caching and Logging Providers


In Memory Caching is available in ServiceStack and ServiceStack.Redis includes the Redis cache client, whilst an OrmLiteCacheClient is available in ServiceStack.Server for utilizing an existing RDBMS as a distributed cache.

Other External caching providers are also available:

AWS Dynamo DB:

PM> Install-Package ServiceStack.Aws


  • ServiceStack
  • AWSSDK.Core
  • AWSSDK.DynamoDBv2


PM> Install-Package ServiceStack.Caching.Memcached


  • ServiceStack.Common
  • EnyimMemcached


PM> Install-Package ServiceStack.Caching.Azure


  • ServiceStack.Common
  • WindowsAzure.Caching


ServiceStack also provides an implementation and dependency-free logging API with adapters for all of .NET's popular logging providers. It allows your business logic to bind to an easily-mockable and testable dependency-free interface whilst providing the flexibility to switch logging providers at runtime.

Console, Debug and Empty logging providers are already in ServiceStack, whilst you can use NuGet to get the adapter for your preferred logging framework:

Additional Formats

Protocol Buffers

Protocol Buffers is a high-performance, compact binary wire format invented by Google who use it internally so they can communicate with their internal network services at very high speed.

You can add it to ServiceStack with:

PM> Install-Package ServiceStack.ProtoBuf

Message Pack

Message Pack is an efficient binary serialization format. It lets you exchange data among multiple languages like JSON but it's faster and smaller and unlike ProtoBuf supports attribute-less POCOs.

You can add it to ServiceStack with:

PM> Install-Package ServiceStack.MsgPack


Wire is a high performance polymorphic serializer for the .NET framework.

You can add it to ServiceStack with:

PM> Install-Package ServiceStack.Wire

External Plugins

See the Documentation on Plugins for the complete list of built-in plugins that are available in ServiceStack.

Open API

Swagger is a specification focused on creating, evolving and promoting a vendor neutral API description format.

ServiceStack implements the Open API specification in a separate package available with:

PM> Install-Package ServiceStack.Api.OpenApi

Swagger API

Swagger is a specification and complete framework implementation for describing, producing, consuming, and visualizing RESTful web services.

ServiceStack implements the Swagger API in a separate package available with:

PM> Install-Package ServiceStack.Api.Swagger

AutoQuery Viewer

ServiceStack.Admin is the home for ServiceStack's new Admin UI with initial support for AutoQuery Viewer - an instant UI for constructing and browsing your AutoQuery Services:

PM> Install-Package ServiceStack.Admin

Build Tasks

Compiled Razor Views

ServiceStack supports compiled views as a separate build task that can

  • Improve performance by eliminating compile times of Razor views
  • provides static compilation benefits by highlighting compile errors during development
  • simplifies deployment by avoiding having to deploy *.cshtml files as they end up pre-compiled in the containing Assembly

PM> Install-Package ServiceStack.Razor.BuildTask

See the docs on Compiled Razor Views for more info.

Portable ServiceStack Desktop Apps

In addition to compiling Razor Views, ServiceStack also has transparent support for embedded resources, allowing your entire application, razor views and web assets to be compiled into .NET dlls that can be ILMerged into a Single cross-platform .exe.

In addition to compiling razor views, the ServiceStack.Gap NuGet package changes all web assets in your VS.NET project to embedded resources.

PM> Install-Package ServiceStack.Gap

See the docs on ServiceStack.Gap project for guides on how to create portable ServiceStack-powered Console, WinForms and Cocoa OSX Desktop Apps.

As ServiceStack is just a pure HTTP web service it can be accessed with any HTTP-capable client. However in order to provide the least friction and most productivity end-to-end, we also maintain generic C# clients available at:

PM> Install-Package ServiceStack.Client

Or use the HttpClient-based JsonHttpClient instead with:

PM> Install-Package ServiceStack.HttpClient

Also includes Android, iOS, Windows Store, WPF and Silverlight clients, see Mobile documentation for more info.

See the Hello Repository for a portable solution showing how to re-use DTO's and client libraries between Android, iOS, Windows Store, WPF and Silverlight platforms.


Service Clients are unrestricted

Explicitly included in the free quotas is an exception enabling free, unrestricted use of ServiceStack Service Clients for calling any ServiceStack service.


Signed Packages

Starting from ServiceStack v5 all .NET 4.5 NuGet packages are now strong named.


.Core Packages

Use .Core packages if running ServiceStack ASP.NET Core on .NET Framework.


External Libraries


Contains a typed .NET client gateway for accessing Stripe's REST API to process merhcant payments and recurring subcriptions online.

PM> Install-Package ServiceStack.Stripe

See the Stripe GitHub repository for documentation and example source code.


Registering your License Key with your ServiceStack Projects

The ServiceStack license key allows un-restricted access to ServiceStack packages and is available in your My Account Section after purchasing a commercial license.

There are multiple ways of registering your license key, all options only need to be added to your top-level host projects:

a) Add it to your Web.Config or appsettings.json

The easiest way to register your license key is in to copy the servicestack:license appSetting into your Web.config or App.config's <appSettings/> config section, e.g:

    <add key="servicestack:license" value="{licenseKeyText}" />

For ASP.NET Core Apps add it to your appsettings.json instead:

    "servicestack": {
        "license": "{licenseKeyText}"

b) Add it in code before your Application Starts Up

By calling Licensing.RegisterLicense() before your application starts up, E.g. For ASP.NET, place it in the Global.asax Application_Start event:

protected void Application_Start(object sender, EventArgs e)
    new AppHost().Init();

Otherwise for a self-hosting Console Application, place it before initializing the AppHost, as shown above.

c) Add the System Environment Variable

To simplify license key registration when developing multiple ServiceStack solutions you can register the License Key once in the SERVICESTACK_LICENSE Environment Variable on each pc using ServiceStack libraries:

Variable               Value    

Note: you'll need to restart IIS or VS.NET for them to pickup any new Environment Variables.

d) Copy license key text into an external text file

Similar to above, we can register the license from an external plain-text file containing the license key text, e.g:

protected void Application_Start(object sender, EventArgs e)
    new AppHost().Init();

For Self-Hosting set the BuildAction to Copy if Newer and use "~/license.txt".MapAbsolutePath() extension method.

Note: the license key is white-space insensitive so can be broken up over multiple lines.

Free Quotas

Whilst ServiceStack v4 is a commercially-supported product, we also allow free usage for small projects and evaluation purposes.
The NuGet packages above include the quota's below which can be unlocked with a license key: