locked
Error in communicating with managed COM dll RRS feed

  • Question

  • Hi,

    My question is about our C# COM dll. This C# COM dll is used in server side code. 

    I have a C# class lib project. This project have wcf service class. A service class has a method in which we are using a VC++ dll using p/invoke.

    This VC++ dll need to call our C# COM dll and pass some arguments from VC++ to C# COM dll. For this, I registered manually our C# COM dll using the Regasm command and kept our VC++ dll and C# COM dll with its generated tlb files in the bin directory. This project is refered in the asp.net website which acts as a hsoting server for our wcf services. 

    When the client calls the service methods, our code loads the VC++ dll and it can communicate to our C# COM dll in the developement environment.

    When we install in IIS 6 (Win XP), it is working fine. but when we install the service in the IIS 7 (In Vista and Win 7), soon after calling the same method, it is thowing the communicationexception error.

    When we debug, we found out the following things :

    1. We called a method in the VC++ dll and passed some arguments from our wcf service.

    2. After that this VC++ dll calls methods in our C# COM dll by passing some parameters.

    3. Again VC++ dll calls another method in another class in our C# COM dll, in which we have some code used (ADO.Net) for saving some data in the database. when it arrives here, the application exits !!! It does not mean that the error occurs of ADO.net objects. 

    we are not able to figure it out. Our C# COM public classes never used any COMVisible attributes. Is that a problem ???

    What could be the mistakes in this case ??

    Thanks in advance.


    • Edited by uksoftengg Tuesday, August 23, 2011 2:26 PM edited
    Tuesday, August 23, 2011 1:29 PM

Answers