Next generation's garbage RSS 2.0
# Friday, November 13, 2009
There appears to be a bug in how Visual Studio does "Add Service Reference" proxy generation for VB.NET projects.

I ran into this issue when trying to add a service reference to Bing Maps and I believe it is not limited to that. I think it stems from it misunderstanding that enum instance variables cannot be tested for equality using .Equals in VB... not sure why.

I think the solution is to simply replace the offending line:
If Me.enumfield.Equals(value) <> true Then
with
If Not Object.Equals(Me.enumfield ,Value) Then

BTW: DO NOT compare boolean results to True or False as they have done!

Use
If boolean_results Then
or
If Not boolean_results Then
[EDIT 2010-07-07]
Specifically, this block of code is wrong:
<System.Runtime.Serialization.DataMemberAttribute()>  _
Public Property CompareOperator() As SearchService.CompareOperator
Get
Return Me.CompareOperatorField
End Get
Set
If (Me.CompareOperatorField.Equals(value) <> true) Then
Me.CompareOperatorField = value
Me.RaisePropertyChanged("CompareOperator")
End If
End Set
End Property
and should be replaced with this:
<System.Runtime.Serialization.DataMemberAttribute()>  _
Public Property CompareOperator() As SearchService.CompareOperator
Get
Return Me.CompareOperatorField
End Get
Set
If Not Object.Equals(Me.CompareOperatorField,value) Then
Me.CompareOperatorField = value
Me.RaisePropertyChanged("CompareOperator")
End If
End Set
End Property
Made this edit so search engines would pick it up... so I can find my own fix next time I run into it. :) [/EDIT]

[EDIT 2011-09-17]
It is still broken in VS2010 and will break your fixed project when upgrading. Gosh, thanks.
[/EDIT]

Friday, November 13, 2009 4:41:25 PM (US Mountain Standard Time, UTC-07:00)  #    Comments [0] -
.NET Internals | Bing Maps | Visual Studio
Archive
<May 2013>
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678
All Content © 2013, Hafthor Stefansson - Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way. - Sign In