Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / September 2007

Tip: Looking for answers? Try searching our database.

Bug in System.Uri constructor?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
serious-sam - 03 Sep 2007 06:16 GMT
Hello all,

 I'm using the System.Uri class to clean up some the URLs we're
passing around, e.g. compacting http://hostname//somefolder//somefile
to http://hostname/somefolder/somefile.

 The documentation clearly states that the Uri constructor takes care
of this:  http://msdn2.microsoft.com/en-us/library/system.uri.aspx

 This works fine on my machine.  However, when I try this on our
server box (Win 2003), I just get back the string I passed to the
constructor.

 I've checked the .NET versions and the assembly versions on both the
target machine and my workstation.  They match.

 Here's the code:

using System;

namespace sandpit
{
   class Program
   {
       public static void Main(string[] args)
       {
           Type type = typeof(Uri);
           Console.WriteLine(type.ToString());
           Console.WriteLine(type.Assembly);
           Console.WriteLine(type.AssemblyQualifiedName);
           Console.WriteLine(type.UnderlyingSystemType);
           Uri uri = new Uri(args.Length == 0 ? "http://hostname///
somefile.txt" : args[0]);
           Console.WriteLine(uri.ToString());
       }
   }
}

 Can someone suggest what might be happening here?  I'm a little
puzzled.

Cheers,
Misha
serious-sam - 13 Sep 2007 00:53 GMT
Well, it's been over a week.  I still haven't been able to find out a
reason why this is so.  A colleagues have reported the same thing
happening as well.  For the time being, I'm going to accept that this
just doesn't work, and opt to scrub URLs manually instead.

Sam

>   Hello all,
>
[quoted text clipped - 40 lines]
> Cheers,
> Misha

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.