This tutorial walks you through the steps of creating and sharing a stateless Service Fabric service.
- Launch Visual Studio 2015/2017.
- Create a new Service Fabric Application with a new Stateless Service named MyCoolService.
- Build the solution.
- Package your Service Fabric application by right-clicking on the application project and selecting the Package menu.
- Launch PowerShell.
- Create a serice NuGet package (writing to d:\temp folder):
New-ServiceFabricNuGetPackage -InputPath <path to your Service Fabric application>\pkg\Debug\MyCoolServicePkg d:\temp- Now, you can find the MyCoolService.1.0.0.nupkg package under the d:\temp folder.
The NuGet package is now ready to be published and shared with your customers.
To simulate the experience of your service users, you’ll create a new Service Fabric application and add the above NuGet package to the new application.
- Create a new Service Fabric Application with a new Stateless Service named TempService.
Note The TempService service isn't needed. Service Fabric tooling doesn't allow creating an empty application, so we need to add a dummy service. You can remove the service after you've created the application.
-
In Solution Explorer, right-click on the solution node and select the Manage Nuget Packages for Solution menu.
-
Browse to the MyCoolService package. Check the application project, and then click on the Install button, as shown in the following figure:

-
Now your application is configured with the MyCoolService service! Simply publish your application.
Once the application is deployed, you can observe how MyCoolService has been deployed along your own services:
