tags:

views:

40

answers:

2

I have a app fabric service that I want to test. (http://xxx.cloudapp.net:8081/service.svc).
I created a console app and added a service reference to the service and got the following error:

Could not load file or assembly 'Microsoft.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

I added a reference to Microsoft.ServiceBus from C:\Program Files (x86)\Windows Azure platform AppFabric SDK\V1.0\Assemblies\NET4.0

I set all assemblies in my project to Copy Local = True, as suggested here: http://msdn.microsoft.com/en-us/library/ee706702.aspx

Additional Due diligence: I opened Microsoft.ServiceBus in red-gate's reflector and confirmed that it is the correct version. Just for kicks, I also added references to each assembly referenced in reflector and set all references to copy local = true.

Any other ideas?

…Peter

+1  A: 

ServiceBus dll is not installed on Azure boxes

  1. Make sure your reference to the assembly specifies COPY LOCAL
  2. Also make sure you don’t have references to the service bus dll in upper projects which do NOT copy local (this might be your problem if you have verified 1 above)

You can check the CSX tree for your azure build folder to see if the assembly is being copied into the final package. That’s a lot quicker than uploading to azure or starting the dev fabric.

That should solve your problem

Rajesh Batheja
Thanks Rajesh for the response. I didn't understand what you meant by ServiceBus is not installed on Azure boxes. The way I understood it, it didn't make sense that MS wouldn't install a required dll for Azure on their own boxes. It turns out that I needed to add it to the azure project, which gets installed on the azure boxes.
Peter Walke
+1  A: 

When you reference Microsoft.ServiceBus.dll, reference it from the install location, e.g.,

C:\Program Files (x86)\Windows Azure platform AppFabric
SDK\V1.0\Assemblies\NET4.0\Microsoft.ServiceBus.dll

... not from the GAC, and set Copy Local to true.

You need to do this in whatever you are deploying into Azure; the Microsoft.ServiceBus.dll needs to packaged with your project because it is not available by default in Azure.

If you fire up Fiddler, you see a 500 error when calling the service. This proves that the exception isn't in your calling application.

George Durzi