Use Visual Studio to create and publish .Net Core applications targeting a remote Linux Service Fabric cluster
With Visual Studio tooling you can develop and publish Service Fabric .Net Core applications targeting a Linux Service Fabric cluster. The SDK version must be 3.4 or above to deploy a .Net Core application targeting Linux Service Fabric clusters from Visual Studio.
Visual Studio doesn't support debugging Service Fabric applications which target Linux.
Create a Service Fabric application targeting .Net Core
- Launch Visual Studio as an administrator.
- Create a project with File->New->Project.
- In the New Project dialog, choose Cloud -> Service Fabric Application.
- Name the application and click Ok.
- On the New Service Fabric Service page, select the type of service you would like to create under the .Net Core Section.
Deploy to a remote Linux cluster
- In the solution explorer, right click on the application and select Build.
- Once the build process for the application has completed, right click on the service and select edit the csproj file.
- Edit the UpdateServiceFabricManifestEnabled property from True to False if the service is an actor project type. If your application does not have an actor service, skip to step 4.
Setting UpdateServiceFabricManifestEnabled to false, will disable updates to the ServiceManifest.xml during a build. Any change such as add, remove, or rename to the service will not be reflected in the ServiceManifest.xml. If any changes are made you must either update the ServiceManifest manually or temporarily set UpdateServiceFabricManifestEnabled to true and build the service that will update the ServiceManifest.xml and then revert it back to false.
- Update the RuntimeIndetifier from win7-x64 to the target platform in the service project.
- In the ServiceManifest, update the entrypoint program to remove .exe.
<EntryPoint> <ExeHost> <Program>Actor1</Program> </ExeHost> </EntryPoint>
- In Solution Explorer, right-click on the application and select Publish. The Publish dialog box appears.
- In Connection Endpoint, select the endpoint for the remote Service Fabric Linux cluster that you would like to target.