Book Image

ServiceStack 4 Cookbook

Book Image

ServiceStack 4 Cookbook

Overview of this book

Table of Contents (18 chapters)
ServiceStack 4 Cookbook
About the Authors
About the Reviewers

Creating a ServiceStack solution with Visual Studio and NuGet

We'll use Visual Studio in the examples within this book. If you don't have access to Visual Studio 2013 Professional or higher, it's highly recommended that you use Microsoft's new free version of Visual Studio, Visual Studio Community Edition 2013. The community edition enables the use of extensions. ServiceStack has its own Visual Studio extension called ServiceStackVS, which is available from within Visual Studio or via the Visual Studio Gallery.

If you are currently stuck with a Visual Studio Express version or an earlier version of Visual Studio, such as Visual Studio 2010, this appendix will walk you through the steps to get you started from an empty project. Everything in this appendix can be done from a ServiceStackVS project template. Check out the Visual Studio 2013 Community Edition at the Visual Studio website at

Once you have Visual Studio installed, run it, and click on New Project. You'll be prompted to choose a project type, respond by selecting Web and then ASP.NET Web Application. Name the solution. The following screenshot depicts the actions to be performed to set up the project in Visual Studio:

Once you click on OK, your solution will be created. Choose the Empty project type. Don't check the Add Unit Tests checkmark; we'll be adding NUnit with NuGet later. The following screenshot depicts the actions explained in this paragraph:

The next thing you need to do is pull in the ServiceStack framework via Nuget. To do that, find Package Manager Console in Visual Studio and enter the following command:

Install-Package ServiceStack

NuGet will download the ServiceStack binaries and add references to them to our project. You should see messages of the form Successfully added ServiceStack. <version number> to <SolutionName> in the output if this succeeded.