[Mono-bugs] [Bug 655474] New: JavaScriptSerializer cannot serialize a relative Uri

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Nov 23 06:46:48 EST 2010


https://bugzilla.novell.com/show_bug.cgi?id=655474

https://bugzilla.novell.com/show_bug.cgi?id=655474#c0


           Summary: JavaScriptSerializer cannot serialize a relative Uri
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.8.x
          Platform: VMWare
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: mhabersack at novell.com
        ReportedBy: gary.thomas at ioko.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=401769)
 --> (http://bugzilla.novell.com/attachment.cgi?id=401769)
NUnit test Case to reproduce

User-Agent:       Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0;
Trident/5.0)

When serializing a relative Uri the following exception is thrown. This does
not happen on Microsoft .net.

at System.Uri.EnsureAbsoluteUri () [0x00000] in <filename unknown>:0
at System.Uri.get_Scheme () [0x00000] in <filename unknown>:0
at System.Uri.get_Parser () [0x00000] in <filename unknown>:0
at System.Uri.GetComponents (UriComponents components, UriFormat format)
[0x00000] in <filename unknown>:0
at System.Web.Script.Serialization.JsonSerializer.WriteValue
(System.Text.StringBuilder output, System.Uri value) [0x00000] in <filename
unknown>:0
at System.Web.Script.Serialization.JsonSerializer.SerializeValueImpl
(System.Object obj, System.Text.StringBuilder output) [0x00000] in <filename
unknown>:0
at System.Web.Script.Serialization.JsonSerializer.SerializeValue (System.Object
obj, System.Text.StringBuilder output) [0x00000] in <filename unknown>:0
at System.Web.Script.Serialization.JsonSerializer.DoSerialize (System.Object
obj, System.Text.StringBuilder output) [0x00000] in <filename unknown>:0
at System.Web.Script.Serialization.JsonSerializer.Serialize (System.Object obj,
System.Text.StringBuilder output) [0x00000] in <filename unknown>:0
at System.Web.Script.Serialization.Json.Serialize (System.Object obj,
System.Web.Script.Serialization.JavaScriptSerializer jss,
System.Text.StringBuilder output) [0x00000] in <filename unknown>:0
at System.Web.Script.Serialization.JavaScriptSerializer.Serialize
(System.Object obj, System.Text.StringBuilder output) [0x00000] in <filename
unknown>:0
at JavaScriptUriSerialization.JavaScriptUriSerializationTests.TestRelativeUri
() [0x00000] in <filename unknown>:0

Reproducible: Always

Steps to Reproduce:
1. Run the attached nunit test case
2.
3.
Actual Results:  
An exception is thrown:
at System.Uri.EnsureAbsoluteUri () [0x00000] in <filename unknown>:0
at System.Uri.get_Scheme () [0x00000] in <filename unknown>:0
at System.Uri.get_Parser () [0x00000] in <filename unknown>:0
at System.Uri.GetComponents (UriComponents components, UriFormat format)
[0x00000] in <filename unknown>:0
at System.Web.Script.Serialization.JsonSerializer.WriteValue
(System.Text.StringBuilder output, System.Uri value) [0x00000] in <filename
unknown>:0
at System.Web.Script.Serialization.JsonSerializer.SerializeValueImpl
(System.Object obj, System.Text.StringBuilder output) [0x00000] in <filename
unknown>:0
at System.Web.Script.Serialization.JsonSerializer.SerializeValue (System.Object
obj, System.Text.StringBuilder output) [0x00000] in <filename unknown>:0
at System.Web.Script.Serialization.JsonSerializer.DoSerialize (System.Object
obj, System.Text.StringBuilder output) [0x00000] in <filename unknown>:0
at System.Web.Script.Serialization.JsonSerializer.Serialize (System.Object obj,
System.Text.StringBuilder output) [0x00000] in <filename unknown>:0
at System.Web.Script.Serialization.Json.Serialize (System.Object obj,
System.Web.Script.Serialization.JavaScriptSerializer jss,
System.Text.StringBuilder output) [0x00000] in <filename unknown>:0
at System.Web.Script.Serialization.JavaScriptSerializer.Serialize
(System.Object obj, System.Text.StringBuilder output) [0x00000] in <filename
unknown>:0
at JavaScriptUriSerialization.JavaScriptUriSerializationTests.TestRelativeUri
() [0x00000] in <filename unknown>:0

Expected Results:  
Test should pass

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list