Execute service fabric .net client code on hosts (build machines) without installing the runtime and sdk
Provide a nuget package with all of the needed assemblies to run service fabric client applications without installing the whole service fabric runtime and sdk on the host machines. This is especially useful when executing service fabric client code on build servers. Installing the whole sdk and runtime creates unnecessary overhead when working on Continuous Integration/Deployment/Delivery pipelines.
We have written several tests that check the health status of some service fabric applications. The tests are executed on VSTS hosted agents. All worked well until we decided to upgrade to service fabric version 6.0. Then it turned out that the hosted agents in VSTS are not upgraded with the latest version of the runtime and also 6.0 is not backward compatible. Even simple calls like the one below started failing.
FabricClient fabricClient = new FabricClient(ClusterConnection);
At first I tried to add a build step to install the service fabric runtime and sdk on the hosted agent using the unattended mode. This was also kind of a challenge of its own as I had to use the .net reflector to find out that there is a /QUIET property on the runtime that I could use. It would be helpful to provide a help option to the exe or use a standad MSI. Unfortunately even using the /QUIET flag the installation failed as it required interactive mode. (Still I don't like the idea of installing unneeded software on my build servers as it requires maintenance and takes time for each build.)
Then I looked at the runtime installed on my machine and after several experiments I found out that to run service fabric clients you just need the following assemblies added to your bin folder:
I packed these assemblies in a nuget package, pushed it to a private feed and added the package to my project. Since then my tests are executing on machines that don't have the runtime and sdk installed and everything seems to work. Still there might be cases where something is not covered by these assemblies. It would be much better to provide an official nuget package with those and other assemblies that are needed for service fabric client code. It would boost the developer productivity.
Giri Bhatnagar commented
I want this too. We are writing an external watchdog for monitoring our cluster. We plan to do this using an AzureFunction that would query the cluster health on intervals. But we can't use Fabric Client since it cant work without the Service Fabric runtime.