Re: System.Net.Dns.Resolve & System.Net.Dns.GetHostByAddress bugs

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Paul G. Tobey [eMVP] (ptobey)
Date: 12/30/04


Date: Thu, 30 Dec 2004 14:14:58 -0700

If Dns.Resolve() doesn't handle passing an IP address, I wouldn't call that
a bug. It should be documented, if that is, in fact, the case, but it is
quite a reasonable thing for it to do. The bad part is if that *isn't* how
it works on the desktop.

Yes, I feel your pain with respect to changes in actual functionality from
SP to SP. My hope would be that what works in earlier versions, provided
it's valid, still works in later versions. The exceptions are likely a
response to something that actually is not valid, however. Your read-only
case is a good one; it's actually *better* to throw an exception, in that
case, since that gives the application proper information that it should
have before hauling off and changing a file that the user has marked as
read-only. You're much more likely to give the user what he wants there.
Unfortunately, there doesn't seem to be a reasonable way to mark and EXE for
"SP1 functionality" , rather than SP2 and have some things like that keep
working as before.

I've read your message on the Web stuff and don't have an answer for you
(you can tell that, if I have an answer, it almost always gets posted).

Happy New Year to you, as well!

Paul T.

"Gen" <gen@godeltech.com> wrote in message
news:FC6393D6-957D-4F4B-BF30-D3AB6D4B103C@microsoft.com...
> Really i didn't test it on installed SP2, and I already try to parse
> hostName
> on case with IP .
>
> It's very very strange why in CF so many bugs (Is this really MS product?
> :)
> ).
>
> I willl not test it on SP2 now. I'm not QA manger - i'm developer.
>
> So at the first i develope working code for CF without SP,
> than I try to test it on SP1 and SP2 (There were situations, when it
> throws
> new exceptions on SP2, for example without SP readonly file attribute is
> ignored, but on SP2 code which try modify these files throws exception).
>
> Really, problem with IP resolving wasn't big for me - just it was very
> strange.
>
> But in case when i have use HttpWebRequest & HttpWebResponse (please see
> question without answers "Locking web server after 2nd wrong
> authorization"
> which was posted at 27 dec.) it trouble was big for project terms. I lost
> 2
> days because i tried to find out solution and than have develope own http
> client routine based on sockets.
>
> I hope that in new year The Mobile World will get a stable CF. I know that
> you can do it.
>
> Happy New Year!
>
> Best regards,
> Gennady
>
> "Paul G. Tobey [eMVP]" wrote:
>
>> Make sure that you're using SP2 on the device and try it there. There is
>> also a thread from a while back concerning this and it may still be true:
>>
>> http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework/browse_thread/thread/8647c7585eb70dfc/a64036b464885c57?q=dns+resolve&_done=%2Fgroup%2Fmicrosoft.public.dotnet.framework.compactframework%2Fsearch%3Fgroup%3Dmicrosoft.public.dotnet.framework.compactframework%26q%3Ddns+resolve%26qt_g%3D1%26&_doneTitle=Back+to+Search&&d#a64036b464885c57
>>
>> Paul T.
>>
>> "Gen" <gen@godeltech.com> wrote in message
>> news:5F3513AE-7379-494F-9090-BD4D34A6026B@microsoft.com...
>> > realy there is uri.Host (type is string), "192.168.1.2" - this is real
>> > IP
>> > in
>> > my local network this is Axis camera IP, my PC IP address in network is
>> > different of course.
>> > i have tested it only on emulator (Pocket PC 2003), CF without SP,
>> > "Paul
>> > G.
>> > Tobey
>> >
>> > Also I have test it on another web server when i put there "shlang"
>> > (this
>> > is
>> > a name of PC in my local network which has IP 192.168.1.131) all works,
>> > but
>> > when i put string "192.168.1.131" it is throws exception.
>> >
>> > P.S. can you help me with question "27 Dec" "Locking web server...." ?
>> >
>> > [eMVP]" wrote:
>> >
>> >> Can you print exactly what you are passing in that parameter?
>> >>
>> >> Paul T.
>> >>
>> >> "Gen" <Gen@discussions.microsoft.com> wrote in message
>> >> news:05990084-4530-469A-B809-35063EBBF3E0@microsoft.com...
>> >> > Hi all,
>> >> >
>> >> > Why this functions throws exception "No such host is known" on
>> >> > string
>> >> > which
>> >> > contains IP address?
>> >> >
>> >> > Best regards,
>> >> > Gennady
>> >> >
>> >> >
>> >>
>> >>
>> >>
>>
>>
>>



Relevant Pages

  • Re: Office 2003 SP3 causes problems in Access 2003
    ... then use the downloads page to patch to SP2. ... to not hit the bug but get as many ... Todd Tharp ...
    (microsoft.public.officeupdate)
  • Re: Structured exception information
    ... subprograms should raise exceptions because of precondition ... A precondition violation is not an exceptional state, it is a bug. ...
    (comp.lang.ada)
  • Re: error defragging index
    ... You're on SP2 and you've hit a bug that is fixed in SP3. ... Microsoft SQL Server Storage Engine ... "Dan D." ...
    (microsoft.public.sqlserver.server)
  • Re: JavaScript error with onChange event handler -- FireFox 1.5
    ... That looks like the old autocomplete bug, but it was fixed in Firefox ... You code runs w/o exceptions on test machines. ... Also this bug leads to an exception, not to an error: ... script execution is not aborted. ...
    (comp.lang.javascript)
  • Re: Exception handling philosophy
    ... Richard Grossman wrote: ... The reports and dialogs displayed could be very helpful and look very professional. ... > 2 There are exceptions that are explicitly handled, such as during opening and saving files, and don't need any additonal handling since they represent a local issue and not a bug. ...
    (borland.public.delphi.non-technical)