0

I am trying to develop a WCF service on 64 bit Win 7. This service has to utilize a third party component to do it's job.

The 3rd party component is instantiated like this

ThirdPartyib.ThirdPartyClass objThird = new ThirdPartyib.ThirdPartyClass;

Invoking the method gives the error

*Failed to invoke the service. Possible causes: The service is offline or inaccessible; the client-side configuration does not match the proxy; the existing proxy is invalid. Refer to the stack trace for more detail. You can try to recover by starting a new proxy, restoring to default configuration, or refreshing the service. *

When I comment out the instantiation part of the third party dll and return a simple string it works fine. Infact I even tried creating a folder locally with the service and that works too. What can I do for the service to work with the 3rd party dll?

This 3rd party dll is 32-bit.

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
Codehelp
  • 4,157
  • 9
  • 59
  • 96
  • 1
    Did you try calling the method directly from a browser? – dutzu Jan 14 '13 at 10:45
  • you can activate tracing inside the service web.config to see the actual failure on the server side. – Dirk Trilsbeek Jan 14 '13 at 11:02
  • Have you tried debugging your service? Or just make a console application and create an instance of the third party component and see what happens. – Björn Jan 14 '13 at 11:04
  • Thanks for your time everyone. I found the solution here. [link](http://stackoverflow.com/questions/3755033/how-do-i-compile-a-wcf-service-library-in-32-bit-mode) – Codehelp Jan 15 '13 at 13:15

2 Answers2

0

Are you hosting this application in IIS? In that case you either need to use x64 and/or anyCpu libraries. Or you will have to tell IIS it's ok to run in 32-bit mode.

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
  • This will be hosted as a Windows service. We had the same problem with the said 3rd party dll in developing Desktop apps when we moved to VS 2010 on Win 64 but that was solved by choosing the option x86 for building. That option does not seem to help here or maybe I don't know how to use it!!! – Codehelp Jan 14 '13 at 11:14
  • Check: http://stackoverflow.com/questions/1079066/forcing-a-net-windows-service-to-run-as-32-bit-on-a-64-bit-machine – jessehouwing Jan 14 '13 at 11:16
0

You'll need to compile your entire service as x86. This includes all of your projects: The service application that hosts the WCF service, the DLL that contains the definition of the WCF service (in case there is such a DLL) and all other libraries you use that are not compiled as Any CPU and which you develop.

Short: The entire solution must by x86 only.

Thorsten Dittmar
  • 55,956
  • 8
  • 91
  • 139