je5real / protobuf-net

Automatically exported from code.google.com/p/protobuf-net
Other
0 stars 0 forks source link

Relative Uri's fail with InvalidOperationException #347

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Quick and dirty:

  byte[] bytes;
  using(var mem = new MemoryStream())
  {
      ProtoBuf.Serializer.Serialize(mem, new Uri("/example/path", UriKind.Relative));
      bytes = mem.ToArray();
  }

What is the expected output? What do you see instead?

Seeing a InvalidOperationException; expected, you know, bytes.  Stacktrace 
attached as .txt file.

http://code.google.com/p/protobuf-net/issues/detail?id=83 leads me to believe 
this should work.

What version of the product are you using? On what operating system?

2.0.0.612, Windows 8 Enterprise 64-bit, .NET 4.5.

Please provide any additional information below.

Gonna guess the serializing failure is here:
http://code.google.com/searchframe#XB9svDNAlPQ/trunk/protobuf-net/Serializers/Ur
iDecorator.cs&l=17

Read(object value, ProtoReader source) right below it probably also needs a 
change to handle relative urls.

Original issue reported on code.google.com by kevin.mo...@gmail.com on 24 Dec 2012 at 2:08

Attachments: