Installing the Service Fabric SDK is a pre-requisite for performing this exercise. The following steps can be followed to create a Guest Executable package using Visual Studio:
- Open Visual Studio and choose New Project.
- Select Service Fabric Application.
- Choose the Guest Executable service template.
- Click Browse and select the folder holding the executable to be packaged.
- Fill in other parameters:
- Code Package Behavior: This is ideally set to copy all the content of the folder to the Visual Studio project. There is also an option to link a folder if you require the project to dynamically pick up the executables every time it executes.
- Program: Choose the executable that should run to start the service.
- Arguments: Input parameters to be passed in as arguments to the executable should be specified here.
- Working Folder: The working folder can be set to one of these three values:
- CodeBase: If you want to set the working folder to the code directory.
- CodePackage: If you want to set the working folder to the root directory.
- Work: If you want to place the files in a sub directory called Work
- Name your service.
- Click OK.
- If the service requires an endpoint communication, you need to edit ServiceManifest.xml to open an endpoint. We will see how this can be done in the next section.
- You can now debug the solution and use package and publish action to deploy the Guest Executable on your local cluster.
- When ready, you can publish the application to a remote cluster using Visual Studio.