kiewic
kiewic

Reputation: 16420

Connect-ServiceFabricCluster : Argument 'Connect-ServiceFabricCluster' is not recognized as a cmdlet: Unable to load DLL 'FabricCommon.dll'

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?

Upvotes: 5

Views: 7616

Answers (7)

shivesh suman
shivesh suman

Reputation: 1709

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

Upvotes: 2

OpMt
OpMt

Reputation: 1742

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

Upvotes: 1

Adriaan de Beer
Adriaan de Beer

Reputation: 1286

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.

Upvotes: 0

Vishal Sharma
Vishal Sharma

Reputation: 3

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

Upvotes: 0

Mike O.
Mike O.

Reputation: 89

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.

Upvotes: 0

callee.args
callee.args

Reputation: 439

Please Run Windows PowerShell as Administrator and then try.

Upvotes: 0

alltej
alltej

Reputation: 7285

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.

Upvotes: 2

Related Questions