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.
Obs!
Visual Studio doesn't support debugging Service Fabric applications which target Linux.
- 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.
- 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 choose to 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.
<UpdateServiceFabricManifestEnabled>False</UpdateServiceFabricManifestEnabled>
Obs!
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.
<RuntimeIdentifier>ubuntu.20.04-x64</RuntimeIdentifier>
- 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.