<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>freachable.net - Bing Maps</title>
    <link>http://freachable.net/</link>
    <description>Next generation's garbage</description>
    <language>en-us</language>
    <copyright>Hafthor Stefansson</copyright>
    <lastBuildDate>Fri, 13 Nov 2009 23:41:25 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.1.8102.813</generator>
    <managingEditor>blog@freachable.net</managingEditor>
    <webMaster>blog@freachable.net</webMaster>
    <item>
      <trackback:ping>http://freachable.net/Trackback.aspx?guid=453a46fd-3285-411b-b7d8-386c1eee6033</trackback:ping>
      <pingback:server>http://freachable.net/pingback.aspx</pingback:server>
      <pingback:target>http://freachable.net/PermaLink,guid,453a46fd-3285-411b-b7d8-386c1eee6033.aspx</pingback:target>
      <dc:creator>Hafthor Stefansson</dc:creator>
      <wfw:comment>http://freachable.net/CommentView,guid,453a46fd-3285-411b-b7d8-386c1eee6033.aspx</wfw:comment>
      <wfw:commentRss>http://freachable.net/SyndicationService.asmx/GetEntryCommentsRss?guid=453a46fd-3285-411b-b7d8-386c1eee6033</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">There appears to be a bug in how Visual
Studio does "Add Service Reference" proxy generation for VB.NET projects.<br /><br />
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.<br /><br />
I think the solution is to simply replace the offending line:<br /><blockquote><font color="#0000ff">If <u>Me</u></font><u>.<i>enumfield</i>.Equals(value)</u> &lt;&gt; <font color="#0000ff">true
Then</font><br /></blockquote>with<br /><blockquote><font color="#0000ff">If Not Object<font color="#000000">.Equals(</font>Me</font>.<i>enumfield</i> ,Value) <font color="#0000ff">Then</font><br /></blockquote><br />
BTW: DO NOT compare boolean results to <font color="#0000ff">True </font>or <font color="#0000ff">False </font>as
they have done!<br /><br />
Use<br /><blockquote><font color="#0000ff">If </font><i>boolean_results</i><font color="#0000ff">Then</font><br /></blockquote>or<br /><blockquote><font color="#0000ff">If Not</font><i>boolean_results</i><font color="#0000ff">Then</font><br /></blockquote>[EDIT 2010-07-07]<br />
Specifically, this block of code is wrong:<br /><pre><span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;">&lt;System.Runtime.Serialization.DataMemberAttribute()&gt;
_<br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Public</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Property</span> CompareOperator() <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">As</span> SearchService.CompareOperator<br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Get</span><br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Return</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Me</span>.CompareOperatorField<br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">End</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Get</span><br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Set</span><br /><span style="background-color: rgb(255, 255, 204);"><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">If</span> (<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Me</span>.CompareOperatorField.Equals(value)
&lt;&gt; <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">true</span>) <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Then</span></span><br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Me</span>.CompareOperatorField <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span> value<br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Me</span>.RaisePropertyChanged(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"CompareOperator"</span>)<br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">End</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">If</span><br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">End</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Set</span><br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">End</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Property</span></span></pre>and
should be replaced with this:<br /><pre><span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;">&lt;System.Runtime.Serialization.DataMemberAttribute()&gt;
_<br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Public</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Property</span> CompareOperator() <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">As</span> SearchService.CompareOperator<br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Get</span><br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Return</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Me</span>.CompareOperatorField<br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">End</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Get</span><br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Set</span><br /><span style="background-color: rgb(255, 255, 204);"><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">If
Not Object</span>.Equals(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Me</span>.CompareOperatorField,value)<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"></span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Then</span></span><br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Me</span>.CompareOperatorField <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span> value<br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Me</span>.RaisePropertyChanged(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"CompareOperator"</span>)<br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">End</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">If</span><br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">End</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Set</span><br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">End</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">Property</span></span></pre>Made
this edit so search engines would pick it up... so I can find my own fix next time
I run into it. :) [/EDIT]<br /><p></p><img width="0" height="0" src="http://freachable.net/aggbug.ashx?id=453a46fd-3285-411b-b7d8-386c1eee6033" /></body>
      <title>Bug in Visual Studio 2008 Add Service Reference for VB.NET</title>
      <guid isPermaLink="false">http://freachable.net/PermaLink,guid,453a46fd-3285-411b-b7d8-386c1eee6033.aspx</guid>
      <link>http://freachable.net/2009/11/13/BugInVisualStudio2008AddServiceReferenceForVBNET.aspx</link>
      <pubDate>Fri, 13 Nov 2009 23:41:25 GMT</pubDate>
      <description>There appears to be a bug in how Visual Studio does "Add Service Reference" proxy generation for VB.NET projects.&lt;br&gt;
&lt;br&gt;
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.&lt;br&gt;
&lt;br&gt;
I think the solution is to simply replace the offending line:&lt;br&gt;
&lt;blockquote&gt;&lt;font color="#0000ff"&gt;If &lt;u&gt;Me&lt;/u&gt;&lt;/font&gt;&lt;u&gt;.&lt;i&gt;enumfield&lt;/i&gt;.Equals(value)&lt;/u&gt; &amp;lt;&amp;gt; &lt;font color="#0000ff"&gt;true
Then&lt;/font&gt;
&lt;br&gt;
&lt;/blockquote&gt;with&lt;br&gt;
&lt;blockquote&gt;&lt;font color="#0000ff"&gt;If Not Object&lt;font color="#000000"&gt;.Equals(&lt;/font&gt;Me&lt;/font&gt;.&lt;i&gt;enumfield&lt;/i&gt; ,Value) &lt;font color="#0000ff"&gt;Then&lt;/font&gt;
&lt;br&gt;
&lt;/blockquote&gt;
&lt;br&gt;
BTW: DO NOT compare boolean results to &lt;font color="#0000ff"&gt;True &lt;/font&gt;or &lt;font color="#0000ff"&gt;False &lt;/font&gt;as
they have done!&lt;br&gt;
&lt;br&gt;
Use&lt;br&gt;
&lt;blockquote&gt;&lt;font color="#0000ff"&gt;If &lt;/font&gt;&lt;i&gt;boolean_results&lt;/i&gt; &lt;font color="#0000ff"&gt;Then&lt;/font&gt;
&lt;br&gt;
&lt;/blockquote&gt;or&lt;br&gt;
&lt;blockquote&gt;&lt;font color="#0000ff"&gt;If Not&lt;/font&gt; &lt;i&gt;boolean_results&lt;/i&gt; &lt;font color="#0000ff"&gt;Then&lt;/font&gt;
&lt;br&gt;
&lt;/blockquote&gt;[EDIT 2010-07-07]&lt;br&gt;
Specifically, this block of code is wrong:&lt;br&gt;
&lt;pre&gt;&lt;span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;&amp;lt;System.Runtime.Serialization.DataMemberAttribute()&amp;gt;
_&lt;br&gt;
&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Property&lt;/span&gt; CompareOperator() &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;As&lt;/span&gt; SearchService.CompareOperator&lt;br&gt;
&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Get&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Return&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Me&lt;/span&gt;.CompareOperatorField&lt;br&gt;
&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;End&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Get&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Set&lt;/span&gt;
&lt;br&gt;
&lt;span style="background-color: rgb(255, 255, 204);"&gt;&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;If&lt;/span&gt; (&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Me&lt;/span&gt;.CompareOperatorField.Equals(value)
&amp;lt;&amp;gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;true&lt;/span&gt;) &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Then&lt;/span&gt;&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Me&lt;/span&gt;.CompareOperatorField &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; value&lt;br&gt;
&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Me&lt;/span&gt;.RaisePropertyChanged(&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"CompareOperator"&lt;/span&gt;)&lt;br&gt;
&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;End&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;If&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;End&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Set&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;End&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Property&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;and
should be replaced with this:&lt;br&gt;
&lt;pre&gt;&lt;span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;&amp;lt;System.Runtime.Serialization.DataMemberAttribute()&amp;gt;
_&lt;br&gt;
&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Property&lt;/span&gt; CompareOperator() &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;As&lt;/span&gt; SearchService.CompareOperator&lt;br&gt;
&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Get&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Return&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Me&lt;/span&gt;.CompareOperatorField&lt;br&gt;
&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;End&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Get&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Set&lt;/span&gt;
&lt;br&gt;
&lt;span style="background-color: rgb(255, 255, 204);"&gt;&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;If
Not Object&lt;/span&gt;.Equals(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Me&lt;/span&gt;.CompareOperatorField,value)&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Then&lt;/span&gt;&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Me&lt;/span&gt;.CompareOperatorField &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; value&lt;br&gt;
&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Me&lt;/span&gt;.RaisePropertyChanged(&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"CompareOperator"&lt;/span&gt;)&lt;br&gt;
&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;End&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;If&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;End&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Set&lt;/span&gt;
&lt;br&gt;
&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;End&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;Property&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;Made
this edit so search engines would pick it up... so I can find my own fix next time
I run into it. :) [/EDIT]&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://freachable.net/aggbug.ashx?id=453a46fd-3285-411b-b7d8-386c1eee6033" /&gt;</description>
      <comments>http://freachable.net/CommentView,guid,453a46fd-3285-411b-b7d8-386c1eee6033.aspx</comments>
      <category>.NET Internals</category>
      <category>Bing Maps</category>
      <category>Visual Studio</category>
    </item>
  </channel>
</rss>