Reference to a non-shared member requires an object reference

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Trying to compile this code:
<System.ComponentModel.Browsable(false), _
System.ComponentModel.DesignerSerializationVisibilityAttribute(System.Compon
entModel.DesignerSerializationVisibility.Content)> _
Public ReadOnly Property vItemLocDiscreps As vItemLocDiscrepsDataTable
Get
Return Me.tablevItemLocDiscreps
End Get
End Property

Results in "Reference to a non-shared member requires an object reference."
I've googled the error, but can not find any reference to this error in this
context, i.e. in function attributes.
This is generated code, and I'd like to try to resolve the issue, before
resorting to removing all the "problem" lines.

Any thoughts on what could be causing this?
 
In which class is this code ? Usually this is because you can't use Me
inside a shared member as you have no current instance...
 
The error is on
System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)

It doesn't appear to be because of the "me" reference, but a problem with
the attribute.
 
turns out there was a namspace conflict, I just needed to Import the
System.Componentmodel namespace.
 
Back
Top