更新到 VS2012 后生成损坏的 Reference.vb
Broken Reference.vb generated after update to VS2012
在我的 WCF 服务中,我有以下 OperationContract:
<OperationContract()>
Function getResults(ByVal Settings As Dictionary(Of String, String)) As IO.Stream
...和消息合约:
<MessageContract()>
Public Class FI
Implements IDisposable
<MessageHeader(MustUnderstand:=True)_
Public id as Integer
<MessageHeader(MustUnderstand:=True)_
Public token as String
<MessageHeader(MustUnderstand:=True)_
Public length as Long
<MessageHeader(MustUnderstand:=True)_
Public del as Char
<MessageHeader(Order:=1)_
Public stream as System.IO.Stream`
Public Sub Dispose() Implements IDisposable.Dispose
FI.Close()
FI=Nothing
End Sub
End Class
在 VS 中配置服务并更新后在客户端出现多个错误:
1) 对于 getResults
:需要 ArrayOfKeyValueOfstringstringKeyValueOfstringstring
而不是字典。我已经将操作合约声明为 <OperationContract(), ServiceKnownType(GetType(Dictionary(Of String, String)))>
但没有成功。我的客户端设置是 CollectionType = Generic.List 和 DictionaryCollectionType = Generic.Dictionary。我也尝试删除并重新添加服务。
2) 对于FI
:使用MessageContract FI 的方法签名期望参数del
为Integer 类型。在这里我不知道该怎么办。
我必须补充一点,直到最近一切正常,我记得的唯一变化是将 Visual Studio 从 2010 年更新到 2012 年。
我刚刚发现潜在的问题是对 .NET 4.5 的更新。这就是我在机器 运行 VS2010 上所做的, 一代使用 工作。 降级到 .NET 4.0 成功了。 VS 中的生成再次工作。
总结:不是VS版本的问题,而是执行VS的机器.NET版本的问题。我猜想 .NET 4.5 中包含的 svcutil(或 VS 中 "Update Service Reference" 函数使用的任何资源)是造成该错误的原因。
在我的 WCF 服务中,我有以下 OperationContract:
<OperationContract()>
Function getResults(ByVal Settings As Dictionary(Of String, String)) As IO.Stream
...和消息合约:
<MessageContract()>
Public Class FI
Implements IDisposable
<MessageHeader(MustUnderstand:=True)_
Public id as Integer
<MessageHeader(MustUnderstand:=True)_
Public token as String
<MessageHeader(MustUnderstand:=True)_
Public length as Long
<MessageHeader(MustUnderstand:=True)_
Public del as Char
<MessageHeader(Order:=1)_
Public stream as System.IO.Stream`
Public Sub Dispose() Implements IDisposable.Dispose
FI.Close()
FI=Nothing
End Sub
End Class
在 VS 中配置服务并更新后在客户端出现多个错误:
1) 对于 getResults
:需要 ArrayOfKeyValueOfstringstringKeyValueOfstringstring
而不是字典。我已经将操作合约声明为 <OperationContract(), ServiceKnownType(GetType(Dictionary(Of String, String)))>
但没有成功。我的客户端设置是 CollectionType = Generic.List 和 DictionaryCollectionType = Generic.Dictionary。我也尝试删除并重新添加服务。
2) 对于FI
:使用MessageContract FI 的方法签名期望参数del
为Integer 类型。在这里我不知道该怎么办。
我必须补充一点,直到最近一切正常,我记得的唯一变化是将 Visual Studio 从 2010 年更新到 2012 年。
我刚刚发现潜在的问题是对 .NET 4.5 的更新。这就是我在机器 运行 VS2010 上所做的, 一代使用 工作。 降级到 .NET 4.0 成功了。 VS 中的生成再次工作。
总结:不是VS版本的问题,而是执行VS的机器.NET版本的问题。我猜想 .NET 4.5 中包含的 svcutil(或 VS 中 "Update Service Reference" 函数使用的任何资源)是造成该错误的原因。