0

If run a WCF service application straight out of the box in 64 bit mode with service selected , it works fine an gives me the default data contracts.

If I change app to x86 and build with x86 ( not any CPU ) - and configure IIS 8 application pool for this application to allow 32 bit - it fails. How do I make the WCF Application work in 32 bit ( it must be 32 bit because it needs to be a wrapper for some legacy dlls ) . Note: I haven't referenced the DLLs or anything - it is just straight out of the box default WCF application ( Not a WCF library ) . help :-)

Martin Thompson
  • 3,415
  • 10
  • 38
  • 62
  • Possible duplicate of [How do I compile a WCF Service Library in 32-bit mode?](https://stackoverflow.com/questions/3755033/how-do-i-compile-a-wcf-service-library-in-32-bit-mode) – ickydime Nov 09 '17 at 19:36

1 Answers1

0

Although I am not sure why it is not working in your case, there are two issues to consider when running in 32-bit mode on 64-bit server:

  • Setting the platform target in Visual Studio: Setting this to x86 will force the target assembly to be built as a 32-bit application. If the assembly that loads the target assembly is running in a 64-bit process, it will fail to load your assembly
    However, you do not have to specify x86 to allow your assembly to be loaded in a 32-bit process. If you specify Any CPU as Platform Target, it can be loaded in either a 32-bit or a 64-bit process.
  • 32-bit IIS process: If your application is running as a web app, (running in an IIS app pool worker process), you’ll want that worker process (w3wp.exe) to be a 32-bit process. That can be specified in the advanced settings of the app pool:

    enter image description here

    Although is says 'Enable', it actually means “force”, meaning that the app pool worker process will always be launched as a 32-bit process when this setting has a value of True. Setting it to False will launch a 64-bit app pool worker process.

sjokkogutten
  • 2,005
  • 2
  • 21
  • 24
  • Yeah sorry done all that. I can: make an ASP.NET MVC app run in 32 bit process. The same process doesn't work with a WCF service application. – Martin Thompson Dec 23 '15 at 17:29
  • Ok. This might be a long shot but could you have a look the machine's `applicationHost.config`. Make sure that the same pools has `Enable 32-Bit Applications` set to True? If they are not, manually edited these entries to True (you might need to recycle app pool, website etc.) – sjokkogutten Dec 24 '15 at 12:14