25 February 2009

Solution to Method has no implementation (no RVA) Error

If you get this exception

System.TypeLoadException: Could not load type ‘x’ from assembly 'xx, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' because the method 'SendMessage' has no implementation (no RVA).

Make sure you have a DllImport attribute for the method.

 

This…

   1:  public static extern IntPtr SendMessage(IntPtr w, uint m, IntPtr p1, IntPtr p2);

Becomes this…

   1:  [DllImport("user32.dll")]
   2:  public static extern IntPtr SendMessage(IntPtr w, uint m, IntPtr p1, IntPtr p2);

 

 

 

 

Technorati Tags: ,,,,,,,,,,,

Filed under: ,
 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Click & Solve » Solution to Method has no implementation (no RVA) Error said:

PingBack from http://www.clickandsolve.com/?p=14273

25 February 09 at 4:52 AM

Leave a Comment

Comment Policy: No HTML allowed. URIs and line breaks are converted automatically. Your e–mail address will not show up on any public page.

(required) 
(optional)
(required) 

  
Enter Code Here: Required
Page view tracker