4
votes

I installed Service Fabric by using the Install the Service Fabric runtime, SDK, and tools for Visual Studio 2015 Update 2 link from Prepare your development environment.

Trying to publish a Service Fabric Application fails with:

2>Connect-ServiceFabricCluster : Argument 'Connect-ServiceFabricCluster' is not recognized as a cmdlet: Unable to load
2>DLL 'FabricCommon.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Same error described in Troubleshoot your local development cluster setup, but it does not matter what PowerShell version I use, 64 or 32.

The Service Fabric SDK version I got is 2.1.163.

I am running Windows 10 10586 with Visual Studio 2015 Update 3.

FabricCommon.dll is located at c:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\FabricCommon.dll

What am I missing?

7
When you say "Trying to publish" do you mean using PowerShell or Visual Studio?CrnaStena
I mean Visual Studio. I got this fixed by rebooting my machine.kiewic
Well good to know that good old reboot still solves most issues.CrnaStena
I restarted my machine and it worked.R.F

7 Answers

2
votes

I will focus on this error first:

DLL 'FabricCommon.dll': The specified module could not be found

You can fix this by re-installing the service fabric SDK. This happens to me before during installation and I thought it was fixed but you never know.

Also make sure you are using the same version of the SDK and nuget package that you referenced in your Service Fabric application.

2
votes

A workaround for this issue (which does not include reinstall of the Service Fabric SDK) is to add the following to your path environment variable and restart the application which is throwing error (Visual Studio or PowerShell so that it can access the new environment variable):

C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code

You do not need to restart your computer, just restart the application after you have update the path environment variable. The dll fabricCommon.dll lives in this folder.

This workaround is inspired by (but is not identical to) the solution to a somewhat related issue presented here: https://social.msdn.microsoft.com/Forums/azure/en-US/6c8cc261-6c84-4097-be03-e8073cbc9397/unable-to-load-dll-fabricruntimedll?forum=AzureServiceFabric&prof=required

0
votes

Please Run Windows PowerShell as Administrator and then try.

0
votes

I have experienced the same problem on my Win10 box, and even adding the relevant powershell module that contained necessary cmdlets didn't work. The solution that worked for me was: Control Panel -> "Programs and Features", uninstall Service Fabric SDK, then click "Turn Windows features on or off" link and uninstall PowerShell. Next, reboot Windows, back to Control Panel -> "Programs and Features" -> "Turn Windows features on or off", install PowerShell, after which download/install Service Fabric SDK. Again, restart the PC, start the Service Fabric Cluster Manager (if it doesn't auto-start), right-click its icon on the task-bar and try creating 1-node or 5-node cluster.

0
votes

I was facing same issue on vs2017 and window server 2016. I reinstalled service fabric sdk and issue fixed.

0
votes

I had similar issue after creating a cluster on windows server 2016.

In my scenario all I had to do was log out/in again and issue was fixed.

You could try restarting VM too - only if it still fails would I try re-installing the SDK.

0
votes

All I had to do is restart Visual Studio and it worked. This happens time to time.