Unamanged types in managed interface generates TypeLoadExcep
From: cdrundles (crundles_at_russellmellon-dot-com.no-spam.invalid)
Date: 02/02/05
- Next message: Larry Brasfield: "Re: Sometjing to solve my problem"
- Previous message: Steve McLellan: "Re: graphics programming with tiff"
- Messages sorted by: [ date ] [ thread ]
Date: 2 Feb 2005 11:58:41 -0600
I received the same error in very similar circumstances.
The failure happened when calling a delegate whose interface is
abstract and whose implementation overrides the interface method.
First thing to verify is that the override keyword is in the
implementation.
Second thing to verify is that the implementation has the same
signature
as the interface (delegate). This can be verified by running:
C:\Program Files\Microsoft Visual Studio .NET
2003\SDK\v1.1\Bin\ildasm.exe (a GUI app)
and opening the DLL containing the implementation and then the one
containing the interface.
The next thing to do is to see if the implementing assembly fails to
load:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfFusionLogViewerFuslogvwexe.asp
give instructions concerning the Fusion Log Viewer.
Bear in mind that this article should have said to add the DWORD
registry variables it refers to as they are not present by default.
In my case, the assembly loaded with no errors. This turned out to be
misleading, for the type load failure was caused by the inability to
load
an assembly on which the current delegate depended.
In particular, the delegate was implemented in one C++ DLL but
returned an object pointer defined in another C++ DLL. It was the
latter DLL that failed to load and yet fuslogvw showed no errors.
My error was resolved by copying the DLL, on which the delegate
implementation depended, to the current directory. I didn't try
having the DLL in LIBPATH, but that may have been sufficient. If you
see success on one system and failure on another, LIBPATH may be an
issue. Since LIBPATH differs for users and system, a load may
succeed for a user but fail for a service. Either way, having the
DLLs in the current directory works.
*---------------------------------*
Posted at: http://www.GroupSrv.com
*---------------------------------*
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
- Next message: Larry Brasfield: "Re: Sometjing to solve my problem"
- Previous message: Steve McLellan: "Re: graphics programming with tiff"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|