Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hello Friends,

I have created a vb.net application in VS2010 and added a service as a reference but when I built the app, reference.vb is throwing multiple errors.

"This is the error: Reference to a non-shared member requires an object reference"

However the same is running fine when I created a c# windows forms application.

VB
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
Public Property MESSAGE_V4() As String
    Get
        Return Me.mESSAGE_V4Field
    End Get
    Set
        Me.mESSAGE_V4Field = value
    End Set
End Property

The references are already there so I am not sure where the issue is.

This is something new to me as I have never seen this issue before and could not find much help on Google as well. If anyone could help. Thanks in advance :)
Posted
Updated 6-May-14 4:45am
v3
Comments
[no name] 6-May-14 10:06am    
http://www.bing.com/search?q=Reference+to+a+non-shared+member+requires+an+object+reference
Joy1979 6-May-14 10:13am    
Thanks Wes Aday, I have already tried all possible solutions available over Google/Bing. Nothing substantial though.
[no name] 6-May-14 10:18am    
Well I am not sure what it is that you think we can do. The error message means exactly what it says. And you are not giving us any code to look at...
Joy1979 6-May-14 10:25am    
Sorry if i wasn't clear enough. I have pasted code where I am getting an error. Hope this helps?
Sergey Alexandrovich Kryukov 6-May-14 10:30am    
No. You need to show the line with the error. It's not in the fragment of code you are showing.
The error is very basic, it tells you that you have no idea of very basic OOP syntax and semantic.
—SA

1 solution

Finally after work around I found solution. It was easy from my end.

Just removed "=System." from reference.vb and application is running smooth.

From:
Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)

To:
Form:=Xml.Schema.XmlSchemaForm.Unqualified)


Thanks everyone for valuable inputs.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900