System.TypeLoadException: Could not load type ‘System.Fabric.Common.CabFileOperations’ from assembly System.Fabric

My azure local cluster was working fine until after I tried installing/adding Microsoft Azure Service Fabric SDK and Tools -2.3.301 (VS2015) through Web Platform Installer.

Whenever I try to debug my microservice solution which would deploy and start the cluster if it is not already running, it prompted the below error (in my VS powershell output and also recorded inside Event Viewer):
System.TypeLoadException: Could not load type ‘System.Fabric.Common.CabFileOperations’ from assembly ‘System.Fabric, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’.
at System.Fabric.FabricDeployer.Utility.GetCurrentCodeVersion(String packageLocation)
at System.Fabric.FabricDeployer.ConfigureOperation.WriteTargetInformationFile(String clusterManifestLocation, String infrastructureManifestLocation, String fabricDataRoot, String machineName, String packageLocation, FabricPackageType fabricPackageType, String sourcePackageLocation)
at System.Fabric.FabricDeployer.ConfigureOperation.OnExecuteOperation(DeploymentParameters parameters, ClusterManifestType clusterManifest, Infrastructure infrastructure)
at System.Fabric.FabricDeployer.DeploymentOperation.ExecuteOperationPrivate(DeploymentParameters parameters)
at System.Fabric.FabricDeployer.DeploymentOperation.ExecuteOperation(DeploymentParameters parameters)
at System.Fabric.FabricDeployer.ConfigurationDeployer.NewNodeConfigurationInner(String clusterManifestPath, String infrastructureManifestPath, String jsonClusterConfigPath, String fabricDataRoot, String fabricLogRoot, String fabricHostCredentialUser, SecureString fabricHostCredentialPassword, Boolean runFabricHostServiceAsManual, Boolean removeExistingConfiguration, FabricPackageType fabricPackageType, String fabricPackageRoot, String machineName, String bootstrapPackagePath)

And searching high and low, someone faced the same error as me posted in https://azure.microsoft.com/en-us/documentation/articles/service-fabric-troubleshoot-local-cluster-setup/ under comments.

I try to look if there is ‘System.Fabric.Common.CabFileOperations’ exist but it didn’t seem to be listed in Microsoft site https://msdn.microsoft.com/en-us/library/azure/system.fabric.common.aspx.

Searching more information on the update that I did, lead me to https://blogs.msdn.microsoft.com/azureservicefabric/2016/10/13/release-of-sdk-2-3-301-and-runtime-5-3-301-for-windows/.

I manage to start my local cluster by uninstalling “Microsoft Azure Service Fabric” of version 5.3.301 and installing the version of
5.2.207 Runtime: http://download.microsoft.com/download/9/E/3/9E31A03B-755C-4C14-89FC-1844E1C80E37/MicrosoftServiceFabric.5.2.207.9590.msi.

Hope it helps for those of you who faced the same issue.

Leave a Reply

Your email address will not be published. Required fields are marked *