Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

'<membername>' is not a member of '<contextname>'; it does not exist in the current context

Visual Studio 2008

A non-existent member name has been assigned to a property in an anonymous type declaration. In the following example, .Prop1 and .Prop2 are the properties of the anonymous type. The attempt to assign .Prop3 to .Prop2 causes the error.

' Not valid.
Dim anon1 = New With {.Prop1 = 27, .Prop2 = .Prop3}

' The assignment is valid if the assigned property has been declared 
' and initialized.
Dim anon2 = New With {.Prop1 = 27, .Prop2 = .Prop1}

Error ID: BC36657

To correct this error

  • Examine your code to determine what you want to assign. The variable name might be misspelled, or it might require qualification if it is a property of another object.

Community Additions

© 2015 Microsoft