Warning: Type library exporter could not find the type library for

G

Guest

Hi,

An interface I have returns System.EnterpriseServices.ITransaction and works
ok from .NET, however when trying to export it to COM, I get this error
message:

--------------
Type library exporter warning processing
'SessionMgrLibNET.ISessionManagerNET.GetDTCTransaction(#0),
SessionMgrLibNET'. Warning: Type library exporter could not find the type
library for System.EnterpriseServices.ITransaction. IUnknown was substituted
for the interface.
------------

I tried to adjust the interface by writing:

------------
public interface ISessionManagerNET
{
[return: MarshalAs(UnmanagedType.Interface)] ITransaction GetDTCTransaction(
SessionManager.SessionDBConnectionType dbType );
}
------------

to no avail.

ITransaction is a public interface in the System.EnterpriseServices
namespace and I have even found its GUID. Why can't the type library marshal
it while it is able to marshal so many others?
 
P

Peter Huang [MSFT]

Hi

I think this is because the ITransaction is a managed interface, it has no
a TypeLib definition according to it. So in the COM world, it have no
information to convert it into a proper Type Library definition, so it use
the IUnknown instead, because the IUnknown is the base interface for all
the Interface.

In the MSDN, the ITransaction is considered as a IUnknown which is now
exposed as IUnknown.

[Guid("0FB15084-AF41-11CE-BD2B-204C4F4F5020")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ITransaction


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top