My WCF Service, written in .NET 4.0, has a problem that the second, or any other call get stuck. The WCF Service does nothing else than calling a COM Object written in Delphi XE. The threading model is set to Both, the InstanceContextMode of the service is set to PerCall. The object does not much more than BSTR DoRequest(BSTR Request). I use Marshal.ReleaseComObject, but read in an article this is not a good way to clean up com objects; i tried it also without.
I tried the following things:
the COM DLL is 32 Bit, so my VStudio Project Settings restrict to x86. I run on Windows 2008 R2. Maybe this does matter: The Delphi COM Object loads a C++ DLL, which might not be treadsafe.
I used Reflector + Dennis Bauer FileDisassembler to decompile the generated COM Wrapper. I dont see any special in it.
Using Windebug seems not very easy, as Delphi does not support PDB Files.
running out of ideas, please help :-)
I added a critical section around all calls to the third party dll inside the delphi code. It looks like it is working now. This does not explain the behaviour of the com object, but now it seems to work.