Juan Dent
7/25/2007 1:36:00 AM
Hi,
In an interop marked assembly, I have a class which implements an interface
defined in another project, also marked for interop, and yet I am getting
this error:
-------------
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(2721,9):
error MSB3217: Cannot register assembly "C:\Exactus\Version
2\Foundation.v2\Exactus.ORM.Session.v2\bin\Debug\Exactus.ORM.Session.v2.dll".
Method 'PrepareInstanceInSession' in type
'Exactus.ORM.Session.v2.SessionManager' from assembly
'Exactus.ORM.Session.v2, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=263f90f9ba01a928' does not have an implementation.
---------------
The strange thing is that there IS AN implementation in that type
(Exactus.ORM.Session.v2.SessionManager) of the method
'PrepareInstanceInSession'. The interface is defined like so:
------
namespace Exactus.ORM.Session.v2
{
[Guid("296F15FF-04FF-4551-B383-15767E809826")]
[Description("ISessionManagerNET2 Interface v2")]
[InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsDual)]
[ComVisible(true)]
public interface ISessionManagerNET2
{
[DispId(2000), Description("Create an instance of a persistence
capable object (either Set or Object) via late binding")]
object CreatePersistenceCapableInstance(string assemblyName, string
qualifiedClassName);
[DispId(2001), Description("Colocar la sesión y los privilegios
sobre un PersistentObject o PersistentSet existente")]
void
PrepareInstanceInSession([MarshalAs(UnmanagedType.IDispatch)]object instance);
}
}
------
While the implementing class in the other assembly is defined:
----
namespace Exactus.ORM.Session.v2
{
[Guid("E9FDFF6D-FAEF-4045-A5E9-37662EBB932E")]
[COMDescription("JD SessionManager Class")]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("Exactus.Session_v2")]
public class SessionManager : ISessionManager, IDisposable,
ISessionManager2, ISessionManagerNET, ISessionManagerNET2
{
[DispId(2001), Description("Colocar la sesión y los privilegios
sobre un PersistentObject o PersistentSet existente")]
public void
PrepareInstanceInSession([MarshalAs(UnmanagedType.IDispatch)] object instance)
{...}
}
// ...
}
----
What's wrong here?
I also tried removing the MarshalAs atttribute from the class and also from
both the class and the interface - none of these scenarios help at all!
--
Thanks in advance,
Juan Dent, M.Sc.