System.MissingMethodException

  • Thread starter Thread starter Kunal Agrawal
  • Start date Start date
K

Kunal Agrawal

Hi,

i m developing a compact framework Dot net application in
C#.I have made a dll(WinSockDll) of my Vb.Net
class "MyNetworkLayer" and added its reference in my C#
project.I am able to access all the methods of the dll at
design time ,after making an object of this class by using:

WinSockDll.MyNetworkLayer net1 =new
WinSockDll.MyNetworkLayer() ;

But at run-time it raises an Error of
type "System.MissingMethodException" at this statement
only.

One thing,In my MyNetworkLayer class ,i could not declared
any constructor for the class as it does not allow me to
do so.Is it because of this reason i m getting this error
as it could not found any constructor for the class?

pls tell me how to avoid this error.I will be really
helpful.


Thanks and Regards,
Kunal
 
yes if you don't have a constructor then you can't create
an instance or use instance methods.
this code is calling a constructor to create an instance:
WinSockDll.MyNetworkLayer net1 =new
WinSockDll.MyNetworkLayer() ;

So if there is no constructor you would get an error.
Why can't you add a constructor?

Joe Audette
 
Back
Top