Reference.vb文件在将WCF服务添加到应用程序时显示多个错误。 [英] Reference.vb file displaying multiple errors when a WCF service is added to the application.
问题描述
Hello Friends,
我在VS2010中创建了一个vb.net应用程序并添加了一个服务作为参考但是当我构建应用程序时,参考.vb会抛出多个错误。
这是错误:对非共享成员的引用需要对象引用
但是当我创建ac#windows表单应用程序时运行正常。
< pre lang =vb>< System.Xml.Serialization.XmlElementAttribute(Form:= System.Xml.Schema.XmlSchemaForm.Unqualified)> _
公开 属性 MESSAGE_V4() As 字符串
获取
返回 我 .mESSAGE_V4Field
结束 获取
设置
我 .mESSAGE_V4Field = value
结束 设置
结束 属性
引用已经存在,所以我不知道在哪里问题是。
这对我来说是新鲜事,因为我之前从未见过这个问题,也无法在Google上找到太多帮助。如果有人可以帮忙。在此先感谢:)
最后,在我找到解决方案之后。从我的角度来看很简单。
刚从reference.vb中删除 = System。,应用程序运行顺畅。
来自:
表格:= System.Xml.Schema.XmlSchemaForm.Unqualified)< br $>
收件人:
表格:= Xml.Schema.XmlSchemaForm.Unqualified)
感谢大家提供有价值的投入。
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.
<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 :)
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.
这篇关于Reference.vb文件在将WCF服务添加到应用程序时显示多个错误。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!