[英]COM Object in WCF Service
My WCF Service, written in .NET 4.0, has a problem that the second, or any other call get stuck. 我的WCF服务,用.NET 4.0编写,存在第二个或任何其他调用卡住的问题。 The WCF Service does nothing else than calling a COM Object written in Delphi XE.
WCF服务除了调用用Delphi XE编写的COM对象之外别无其他。 The threading model is set to Both, the InstanceContextMode of the service is set to PerCall.
线程模型设置为Both,服务的InstanceContextMode设置为PerCall。 The object does not much more than BSTR DoRequest(BSTR Request).
该对象并不比BSTR DoRequest(BSTR请求)多得多。 I use Marshal.ReleaseComObject, but read in an article this is not a good way to clean up com objects;
我使用Marshal.ReleaseComObject,但在文章中读到这不是清理com对象的好方法; i tried it also without.
我也没试过。
I tried the following things: 我尝试了以下事项:
the COM DLL is 32 Bit, so my VStudio Project Settings restrict to x86. COM DLL是32位,所以我的VStudio项目设置限制为x86。 I run on Windows 2008 R2.
我在Windows 2008 R2上运行。 Maybe this does matter: The Delphi COM Object loads a C++ DLL, which might not be treadsafe.
也许这很重要:Delphi COM对象加载一个C ++ DLL,它可能不是特技。
I used Reflector + Dennis Bauer FileDisassembler to decompile the generated COM Wrapper. 我使用Reflector + Dennis Bauer FileDisassembler来反编译生成的COM Wrapper。 I dont see any special in it.
我没有看到任何特别之处。
Using Windebug seems not very easy, as Delphi does not support PDB Files. 使用Windebug似乎不是很容易,因为Delphi不支持PDB文件。
running out of ideas, please help :-) 用完了想法,请帮助:-)
I added a critical section around all calls to the third party dll inside the delphi code. 我在delphi代码中围绕对第三方dll的所有调用添加了一个关键部分。 It looks like it is working now.
看起来它现在正在运作。 This does not explain the behaviour of the com object, but now it seems to work.
这并不能解释com对象的行为,但现在它似乎有效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.