aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcsharptest <roger@csharptest.net>2011-08-05 20:40:14 -0500
committerrogerk <devnull@localhost>2011-08-05 20:40:14 -0500
commit0f3540e24b7b5cf66b59b97cb824fd5449fb77b4 (patch)
treef07ad11ac6c814df0f6b8091eae023cf5f5d5cc1 /src
parent304ff3a83823fdfce6e2eac40cc44e2b4b1fd3c3 (diff)
downloadprotobuf-0f3540e24b7b5cf66b59b97cb824fd5449fb77b4.tar.gz
protobuf-0f3540e24b7b5cf66b59b97cb824fd5449fb77b4.tar.bz2
protobuf-0f3540e24b7b5cf66b59b97cb824fd5449fb77b4.zip
Split off the Serialization namespace into a new assembly.
Diffstat (limited to 'src')
-rw-r--r--src/ProtoBench/ProtoBench.csproj5
-rw-r--r--src/ProtocolBuffers.Serialization/AbstractReader.cs (renamed from src/ProtocolBuffers/Serialization/AbstractReader.cs)40
-rw-r--r--src/ProtocolBuffers.Serialization/AbstractTextReader.cs (renamed from src/ProtocolBuffers/Serialization/AbstractTextReader.cs)7
-rw-r--r--src/ProtocolBuffers.Serialization/AbstractTextWriter.cs (renamed from src/ProtocolBuffers/Serialization/AbstractTextWriter.cs)0
-rw-r--r--src/ProtocolBuffers.Serialization/AbstractWriter.cs (renamed from src/ProtocolBuffers/Serialization/AbstractWriter.cs)0
-rw-r--r--src/ProtocolBuffers.Serialization/DictionaryReader.cs (renamed from src/ProtocolBuffers/Serialization/DictionaryReader.cs)2
-rw-r--r--src/ProtocolBuffers.Serialization/DictionaryWriter.cs (renamed from src/ProtocolBuffers/Serialization/DictionaryWriter.cs)0
-rw-r--r--src/ProtocolBuffers.Serialization/Extensions.cs100
-rw-r--r--src/ProtocolBuffers.Serialization/JsonFormatReader.cs (renamed from src/ProtocolBuffers/Serialization/JsonFormatReader.cs)0
-rw-r--r--src/ProtocolBuffers.Serialization/JsonFormatWriter.cs (renamed from src/ProtocolBuffers/Serialization/JsonFormatWriter.cs)0
-rw-r--r--src/ProtocolBuffers.Serialization/JsonTextCursor.cs (renamed from src/ProtocolBuffers/Serialization/JsonTextCursor.cs)0
-rw-r--r--src/ProtocolBuffers.Serialization/Properties/AssemblyInfo.cs76
-rw-r--r--src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.csproj152
-rw-r--r--src/ProtocolBuffers.Serialization/RecursionLimitExceeded.cs28
-rw-r--r--src/ProtocolBuffers.Serialization/XmlFormatReader.cs (renamed from src/ProtocolBuffers/Serialization/XmlFormatReader.cs)15
-rw-r--r--src/ProtocolBuffers.Serialization/XmlFormatWriter.cs (renamed from src/ProtocolBuffers/Serialization/XmlFormatWriter.cs)0
-rw-r--r--src/ProtocolBuffers.Serialization/XmlReaderOptions.cs (renamed from src/ProtocolBuffers/Serialization/XmlReaderOptions.cs)0
-rw-r--r--src/ProtocolBuffers.Serialization/XmlWriterOptions.cs (renamed from src/ProtocolBuffers/Serialization/XmlWriterOptions.cs)0
-rw-r--r--src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj4
-rw-r--r--src/ProtocolBuffers.Test/TestWriterFormatJson.cs8
-rw-r--r--src/ProtocolBuffers.Test/TestWriterFormatXml.cs8
-rw-r--r--src/ProtocolBuffers.sln13
-rw-r--r--src/ProtocolBuffers/AbstractMessage.cs22
-rw-r--r--src/ProtocolBuffers/GeneratedMessage.cs38
-rw-r--r--src/ProtocolBuffers/IMessage.cs18
-rw-r--r--src/ProtocolBuffers/ProtocolBuffers.csproj14
-rw-r--r--src/ProtocolBuffers2008.sln10
27 files changed, 440 insertions, 120 deletions
diff --git a/src/ProtoBench/ProtoBench.csproj b/src/ProtoBench/ProtoBench.csproj
index 7722f8d2..d2c526dc 100644
--- a/src/ProtoBench/ProtoBench.csproj
+++ b/src/ProtoBench/ProtoBench.csproj
@@ -72,6 +72,11 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
+ <ProjectReference Include="..\ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.csproj">
+ <Project>{231391AF-449C-4a39-986C-AD7F270F4750}</Project>
+ <Name>ProtocolBuffers.Serialization</Name>
+ <Private>True</Private>
+ </ProjectReference>
<ProjectReference Include="..\ProtocolBuffers\ProtocolBuffers.csproj">
<Project>{6908BDCE-D925-43F3-94AC-A531E6DF2591}</Project>
<Name>ProtocolBuffers</Name>
diff --git a/src/ProtocolBuffers/Serialization/AbstractReader.cs b/src/ProtocolBuffers.Serialization/AbstractReader.cs
index bc1fa6cd..f54c2707 100644
--- a/src/ProtocolBuffers/Serialization/AbstractReader.cs
+++ b/src/ProtocolBuffers.Serialization/AbstractReader.cs
@@ -12,8 +12,20 @@ namespace Google.ProtocolBuffers.Serialization
/// </summary>
public abstract class AbstractReader : ICodedInputStream
{
- private const int MaxDepth = CodedInputStream.DefaultRecursionLimit;
- protected int Depth;
+ private const int DefaultMaxDepth = 64;
+ private int _depth;
+
+ /// <summary> Constructs a new reader </summary>
+ protected AbstractReader() { MaxDepth = DefaultMaxDepth; }
+ /// <summary> Constructs a new child reader </summary>
+ protected AbstractReader(AbstractReader copyFrom)
+ {
+ _depth = copyFrom._depth + 1;
+ MaxDepth = copyFrom.MaxDepth;
+ }
+
+ /// <summary> Gets or sets the maximum recursion depth allowed </summary>
+ public int MaxDepth { get; set; }
/// <summary>
/// Merges the contents of stream into the provided message builder
@@ -395,12 +407,12 @@ namespace Google.ProtocolBuffers.Serialization
void ICodedInputStream.ReadGroup(int fieldNumber, IBuilderLite builder, ExtensionRegistry extensionRegistry)
{
- if (Depth++ > MaxDepth)
+ if (_depth++ > MaxDepth)
{
- throw InvalidProtocolBufferException.RecursionLimitExceeded();
+ throw new RecursionLimitExceededException();
}
ReadGroup(builder, extensionRegistry);
- Depth--;
+ _depth--;
}
void ICodedInputStream.ReadUnknownGroup(int fieldNumber, IBuilderLite builder)
@@ -410,12 +422,12 @@ namespace Google.ProtocolBuffers.Serialization
void ICodedInputStream.ReadMessage(IBuilderLite builder, ExtensionRegistry extensionRegistry)
{
- if (Depth++ > MaxDepth)
+ if (_depth++ > MaxDepth)
{
- throw InvalidProtocolBufferException.RecursionLimitExceeded();
+ throw new RecursionLimitExceededException();
}
ReadMessage(builder, extensionRegistry);
- Depth--;
+ _depth--;
}
bool ICodedInputStream.ReadBytes(ref ByteString value)
@@ -566,23 +578,23 @@ namespace Google.ProtocolBuffers.Serialization
void ICodedInputStream.ReadMessageArray<T>(uint fieldTag, string fieldName, ICollection<T> list, T messageType,
ExtensionRegistry registry)
{
- if (Depth++ > MaxDepth)
+ if (_depth++ > MaxDepth)
{
- throw InvalidProtocolBufferException.RecursionLimitExceeded();
+ throw new RecursionLimitExceededException();
}
ReadMessageArray(fieldName, list, messageType, registry);
- Depth--;
+ _depth--;
}
void ICodedInputStream.ReadGroupArray<T>(uint fieldTag, string fieldName, ICollection<T> list, T messageType,
ExtensionRegistry registry)
{
- if (Depth++ > MaxDepth)
+ if (_depth++ > MaxDepth)
{
- throw InvalidProtocolBufferException.RecursionLimitExceeded();
+ throw new RecursionLimitExceededException();
}
ReadGroupArray(fieldName, list, messageType, registry);
- Depth--;
+ _depth--;
}
bool ICodedInputStream.ReadPrimitiveField(FieldType fieldType, ref object value)
diff --git a/src/ProtocolBuffers/Serialization/AbstractTextReader.cs b/src/ProtocolBuffers.Serialization/AbstractTextReader.cs
index 83a8dca5..59b9057b 100644
--- a/src/ProtocolBuffers/Serialization/AbstractTextReader.cs
+++ b/src/ProtocolBuffers.Serialization/AbstractTextReader.cs
@@ -9,6 +9,13 @@ namespace Google.ProtocolBuffers.Serialization
/// </summary>
public abstract class AbstractTextReader : AbstractReader
{
+ /// <summary> Constructs a new reader </summary>
+ protected AbstractTextReader() { }
+ /// <summary> Constructs a new child reader </summary>
+ protected AbstractTextReader(AbstractTextReader copyFrom)
+ : base(copyFrom)
+ { }
+
/// <summary>
/// Reads a typed field as a string
/// </summary>
diff --git a/src/ProtocolBuffers/Serialization/AbstractTextWriter.cs b/src/ProtocolBuffers.Serialization/AbstractTextWriter.cs
index 2c778dfc..2c778dfc 100644
--- a/src/ProtocolBuffers/Serialization/AbstractTextWriter.cs
+++ b/src/ProtocolBuffers.Serialization/AbstractTextWriter.cs
diff --git a/src/ProtocolBuffers/Serialization/AbstractWriter.cs b/src/ProtocolBuffers.Serialization/AbstractWriter.cs
index 6592c1dd..6592c1dd 100644
--- a/src/ProtocolBuffers/Serialization/AbstractWriter.cs
+++ b/src/ProtocolBuffers.Serialization/AbstractWriter.cs
diff --git a/src/ProtocolBuffers/Serialization/DictionaryReader.cs b/src/ProtocolBuffers.Serialization/DictionaryReader.cs
index 70028958..cc5c680c 100644
--- a/src/ProtocolBuffers/Serialization/DictionaryReader.cs
+++ b/src/ProtocolBuffers.Serialization/DictionaryReader.cs
@@ -161,7 +161,7 @@ namespace Google.ProtocolBuffers.Serialization
byte[] rawbytes = null;
if (GetValue(ref rawbytes))
{
- value = ByteString.AttachBytes(rawbytes);
+ value = ByteString.CopyFrom(rawbytes);
return true;
}
return false;
diff --git a/src/ProtocolBuffers/Serialization/DictionaryWriter.cs b/src/ProtocolBuffers.Serialization/DictionaryWriter.cs
index 96175a7e..96175a7e 100644
--- a/src/ProtocolBuffers/Serialization/DictionaryWriter.cs
+++ b/src/ProtocolBuffers.Serialization/DictionaryWriter.cs
diff --git a/src/ProtocolBuffers.Serialization/Extensions.cs b/src/ProtocolBuffers.Serialization/Extensions.cs
new file mode 100644
index 00000000..2050c911
--- /dev/null
+++ b/src/ProtocolBuffers.Serialization/Extensions.cs
@@ -0,0 +1,100 @@
+using System;
+using System.Text;
+using System.IO;
+using System.Xml;
+using Google.ProtocolBuffers.Serialization;
+
+namespace Google.ProtocolBuffers
+{
+ /// <summary>
+ /// Extension methods for using serializers on instances of IMessageLite/IBuilderLite
+ /// </summary>
+ public static class Extensions
+ {
+ #region IMessageLite Extension
+ /// <summary>
+ /// Serializes the message to JSON text. This is a trivial wrapper
+ /// around Serialization.JsonFormatWriter.WriteMessage.
+ /// </summary>
+ public static string ToJson(this IMessageLite message)
+ {
+ JsonFormatWriter w = JsonFormatWriter.CreateInstance();
+ w.WriteMessage(message);
+ return w.ToString();
+ }
+ /// <summary>
+ /// Serializes the message to XML text. This is a trivial wrapper
+ /// around Serialization.XmlFormatWriter.WriteMessage.
+ /// </summary>
+ public static string ToXml(this IMessageLite message)
+ {
+ StringWriter w = new StringWriter(new StringBuilder(4096));
+ XmlFormatWriter.CreateInstance(w).WriteMessage(message);
+ return w.ToString();
+ }
+ /// <summary>
+ /// Serializes the message to XML text using the element name provided.
+ /// This is a trivial wrapper around Serialization.XmlFormatWriter.WriteMessage.
+ /// </summary>
+ public static string ToXml(this IMessageLite message, string rootElementName)
+ {
+ StringWriter w = new StringWriter(new StringBuilder(4096));
+ XmlFormatWriter.CreateInstance(w).WriteMessage(rootElementName, message);
+ return w.ToString();
+ }
+
+ #endregion
+ #region IBuilderLite Extensions
+ /// <summary>
+ /// Merges a JSON object into this builder and returns
+ /// </summary>
+ public static TBuilder MergeFromJson<TBuilder>(this TBuilder builder, string jsonText) where TBuilder : IBuilderLite
+ {
+ return JsonFormatReader.CreateInstance(jsonText)
+ .Merge(builder);
+ }
+ /// <summary>
+ /// Merges a JSON object into this builder and returns
+ /// </summary>
+ public static TBuilder MergeFromJson<TBuilder>(this TBuilder builder, TextReader reader) where TBuilder : IBuilderLite
+ {
+ return MergeFromJson(builder, reader, ExtensionRegistry.Empty);
+ }
+ /// <summary>
+ /// Merges a JSON object into this builder using the extensions provided and returns
+ /// </summary>
+ public static TBuilder MergeFromJson<TBuilder>(this TBuilder builder, TextReader reader, ExtensionRegistry extensionRegistry) where TBuilder : IBuilderLite
+ {
+ return JsonFormatReader.CreateInstance(reader)
+ .Merge(builder, extensionRegistry);
+ }
+
+ /// <summary>
+ /// Merges an XML object into this builder and returns
+ /// </summary>
+ public static TBuilder MergeFromXml<TBuilder>(this TBuilder builder, XmlReader reader) where TBuilder : IBuilderLite
+ {
+ return MergeFromXml(builder, XmlFormatReader.DefaultRootElementName, reader, ExtensionRegistry.Empty);
+ }
+
+ /// <summary>
+ /// Merges an XML object into this builder and returns
+ /// </summary>
+ public static TBuilder MergeFromXml<TBuilder>(this TBuilder builder, string rootElementName, XmlReader reader) where TBuilder : IBuilderLite
+ {
+ return MergeFromXml(builder, rootElementName, reader, ExtensionRegistry.Empty);
+ }
+
+ /// <summary>
+ /// Merges an XML object into this builder using the extensions provided and returns
+ /// </summary>
+ public static TBuilder MergeFromXml<TBuilder>(this TBuilder builder, string rootElementName, XmlReader reader,
+ ExtensionRegistry extensionRegistry) where TBuilder : IBuilderLite
+ {
+ return XmlFormatReader.CreateInstance(reader)
+ .Merge(rootElementName, builder, extensionRegistry);
+ }
+
+ #endregion
+ }
+}
diff --git a/src/ProtocolBuffers/Serialization/JsonFormatReader.cs b/src/ProtocolBuffers.Serialization/JsonFormatReader.cs
index d4505d70..d4505d70 100644
--- a/src/ProtocolBuffers/Serialization/JsonFormatReader.cs
+++ b/src/ProtocolBuffers.Serialization/JsonFormatReader.cs
diff --git a/src/ProtocolBuffers/Serialization/JsonFormatWriter.cs b/src/ProtocolBuffers.Serialization/JsonFormatWriter.cs
index d54507cc..d54507cc 100644
--- a/src/ProtocolBuffers/Serialization/JsonFormatWriter.cs
+++ b/src/ProtocolBuffers.Serialization/JsonFormatWriter.cs
diff --git a/src/ProtocolBuffers/Serialization/JsonTextCursor.cs b/src/ProtocolBuffers.Serialization/JsonTextCursor.cs
index 48e84ccc..48e84ccc 100644
--- a/src/ProtocolBuffers/Serialization/JsonTextCursor.cs
+++ b/src/ProtocolBuffers.Serialization/JsonTextCursor.cs
diff --git a/src/ProtocolBuffers.Serialization/Properties/AssemblyInfo.cs b/src/ProtocolBuffers.Serialization/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..fdae52b8
--- /dev/null
+++ b/src/ProtocolBuffers.Serialization/Properties/AssemblyInfo.cs
@@ -0,0 +1,76 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc. All rights reserved.
+// http://github.com/jskeet/dotnet-protobufs/
+// Original C++/Java/Python code:
+// http://code.google.com/p/protobuf/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+using System;
+using System.Reflection;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+
+[assembly: AssemblyTitle("ProtocolBuffers")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("ProtocolBuffers")]
+[assembly: AssemblyCopyright("Copyright © 2008")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+
+[assembly: Guid("279b643d-70e8-47ae-9eb1-500d1c48bab6")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("2.3.0.277")]
+
+[assembly: AssemblyVersion("2.3.0.277")]
+#if !COMPACT_FRAMEWORK_35
+
+[assembly: AssemblyFileVersion("2.3.0.277")]
+#endif
+
+[assembly: CLSCompliant(true)] \ No newline at end of file
diff --git a/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.csproj b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.csproj
new file mode 100644
index 00000000..0c53577c
--- /dev/null
+++ b/src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.csproj
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{231391AF-449C-4A39-986C-AD7F270F4750}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Google.ProtocolBuffers.Serialization</RootNamespace>
+ <AssemblyName>Google.ProtocolBuffers.Serialization</AssemblyName>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <SignAssembly>true</SignAssembly>
+ <AssemblyOriginatorKeyFile>..\..\keys\Google.ProtocolBuffers.snk</AssemblyOriginatorKeyFile>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ <OldToolsVersion>3.5</OldToolsVersion>
+ <PublishUrl>publish\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
+ <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoStdLib>true</NoStdLib>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
+ <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoStdLib>true</NoStdLib>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug_Silverlight2|AnyCPU'">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug_Silverlight2\</OutputPath>
+ <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
+ <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT2</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoStdLib>true</NoStdLib>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release_Silverlight2|AnyCPU'">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release_Silverlight2\</OutputPath>
+ <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
+ <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
+ <DefineConstants>TRACE;SILVERLIGHT2</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoStdLib>true</NoStdLib>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="mscorlib" />
+ <Reference Include="System" />
+ <Reference Include="System.Xml" />
+ <!-- Only for 2.x compatibility of extension methods -->
+ <Reference Include="System.Core">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\lib\System.Core\System.Core.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Extensions.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="AbstractReader.cs" />
+ <Compile Include="AbstractTextReader.cs" />
+ <Compile Include="AbstractTextWriter.cs" />
+ <Compile Include="AbstractWriter.cs" />
+ <Compile Include="DictionaryReader.cs" />
+ <Compile Include="DictionaryWriter.cs" />
+ <Compile Include="JsonFormatReader.cs" />
+ <Compile Include="JsonFormatWriter.cs" />
+ <Compile Include="JsonTextCursor.cs" />
+ <Compile Include="RecursionLimitExceeded.cs" />
+ <Compile Include="XmlFormatReader.cs" />
+ <Compile Include="XmlFormatWriter.cs" />
+ <Compile Include="XmlReaderOptions.cs" />
+ <Compile Include="XmlWriterOptions.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+ <Visible>False</Visible>
+ <ProductName>Windows Installer 3.1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\ProtocolBuffers\ProtocolBuffers.csproj">
+ <Project>{6908BDCE-D925-43F3-94AC-A531E6DF2591}</Project>
+ <Name>ProtocolBuffers</Name>
+ <Private>False</Private>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition=" '$(Configuration)' == 'Debug' " />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition=" '$(Configuration)' == 'Release' " />
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight\v2.0\Microsoft.Silverlight.CSharp.targets" Condition=" '$(Configuration)' == 'Debug_Silverlight2' " />
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight\v2.0\Microsoft.Silverlight.CSharp.targets" Condition=" '$(Configuration)' == 'Release_Silverlight2' " />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project> \ No newline at end of file
diff --git a/src/ProtocolBuffers.Serialization/RecursionLimitExceeded.cs b/src/ProtocolBuffers.Serialization/RecursionLimitExceeded.cs
new file mode 100644
index 00000000..cdecb525
--- /dev/null
+++ b/src/ProtocolBuffers.Serialization/RecursionLimitExceeded.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Google.ProtocolBuffers.Serialization
+{
+ /// <summary>
+ /// The exception raised when a recursion limit is reached while parsing input.
+ /// </summary>
+#if !SILVERLIGHT2
+ [Serializable]
+#endif
+ public sealed class RecursionLimitExceededException : FormatException
+ {
+ const string message = "Possible malicious message had too many levels of nesting.";
+
+ internal RecursionLimitExceededException() : base(message)
+ {
+ }
+
+#if !SILVERLIGHT2
+ private RecursionLimitExceededException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
+ : base(info, context)
+ {
+ }
+#endif
+ }
+}
diff --git a/src/ProtocolBuffers/Serialization/XmlFormatReader.cs b/src/ProtocolBuffers.Serialization/XmlFormatReader.cs
index 112910a7..cb2cb2ea 100644
--- a/src/ProtocolBuffers/Serialization/XmlFormatReader.cs
+++ b/src/ProtocolBuffers.Serialization/XmlFormatReader.cs
@@ -76,6 +76,17 @@ namespace Google.ProtocolBuffers.Serialization
}
/// <summary>
+ /// Constructs the XmlFormatReader with the XmlReader and options
+ /// </summary>
+ protected XmlFormatReader(XmlFormatReader copyFrom, XmlReader input)
+ : base(copyFrom)
+ {
+ _input = input;
+ _rootElementName = copyFrom._rootElementName;
+ Options = copyFrom.Options;
+ }
+
+ /// <summary>
/// Gets or sets the options to use when reading the xml
/// </summary>
public XmlReaderOptions Options { get; set; }
@@ -104,9 +115,7 @@ namespace Google.ProtocolBuffers.Serialization
private XmlFormatReader CloneWith(XmlReader rdr)
{
- XmlFormatReader copy = new XmlFormatReader(rdr).SetOptions(Options);
- copy._rootElementName = _rootElementName;
- copy.Depth = Depth;
+ XmlFormatReader copy = new XmlFormatReader(this, rdr);
return copy;
}
diff --git a/src/ProtocolBuffers/Serialization/XmlFormatWriter.cs b/src/ProtocolBuffers.Serialization/XmlFormatWriter.cs
index fd36c1de..fd36c1de 100644
--- a/src/ProtocolBuffers/Serialization/XmlFormatWriter.cs
+++ b/src/ProtocolBuffers.Serialization/XmlFormatWriter.cs
diff --git a/src/ProtocolBuffers/Serialization/XmlReaderOptions.cs b/src/ProtocolBuffers.Serialization/XmlReaderOptions.cs
index f7eca1d7..f7eca1d7 100644
--- a/src/ProtocolBuffers/Serialization/XmlReaderOptions.cs
+++ b/src/ProtocolBuffers.Serialization/XmlReaderOptions.cs
diff --git a/src/ProtocolBuffers/Serialization/XmlWriterOptions.cs b/src/ProtocolBuffers.Serialization/XmlWriterOptions.cs
index 7d740ee3..7d740ee3 100644
--- a/src/ProtocolBuffers/Serialization/XmlWriterOptions.cs
+++ b/src/ProtocolBuffers.Serialization/XmlWriterOptions.cs
diff --git a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj b/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj
index 5e319875..bf224264 100644
--- a/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj
+++ b/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj
@@ -124,6 +124,10 @@
<Compile Include="WireFormatTest.cs" />
</ItemGroup>
<ItemGroup>
+ <ProjectReference Include="..\ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.csproj">
+ <Project>{231391AF-449C-4a39-986C-AD7F270F4750}</Project>
+ <Name>ProtocolBuffers.Serialization</Name>
+ </ProjectReference>
<ProjectReference Include="..\ProtocolBuffers\ProtocolBuffers.csproj">
<Project>{6908BDCE-D925-43F3-94AC-A531E6DF2591}</Project>
<Name>ProtocolBuffers</Name>
diff --git a/src/ProtocolBuffers.Test/TestWriterFormatJson.cs b/src/ProtocolBuffers.Test/TestWriterFormatJson.cs
index fe6c22b4..3f534fc0 100644
--- a/src/ProtocolBuffers.Test/TestWriterFormatJson.cs
+++ b/src/ProtocolBuffers.Test/TestWriterFormatJson.cs
@@ -38,7 +38,7 @@ namespace Google.ProtocolBuffers
TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build();
string json = msg.ToJson();
Assert.AreEqual("{\"default_bool\":true}", json);
- TestAllTypes copy = TestAllTypes.ParseFromJson(json);
+ TestAllTypes copy = new TestAllTypes.Builder().MergeFromJson(json).Build();
Assert.IsTrue(copy.HasDefaultBool && copy.DefaultBool);
Assert.AreEqual(msg, copy);
}
@@ -49,7 +49,7 @@ namespace Google.ProtocolBuffers
TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build();
string json = msg.ToJson();
Assert.AreEqual("{\"default_bool\":true}", json);
- TestAllTypes copy = TestAllTypes.ParseFromJson(new StringReader(json));
+ TestAllTypes copy = new TestAllTypes.Builder().MergeFromJson(new StringReader(json)).Build();
Assert.IsTrue(copy.HasDefaultBool && copy.DefaultBool);
Assert.AreEqual(msg, copy);
}
@@ -337,13 +337,13 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(3, ordinal);
Assert.AreEqual(3, builder.TextlinesCount);
}
- [Test,ExpectedException(typeof(InvalidProtocolBufferException))]
+ [Test,ExpectedException(typeof(RecursionLimitExceededException))]
public void TestRecursiveLimit()
{
StringBuilder sb = new StringBuilder(8192);
for (int i = 0; i < 80; i++)
sb.Append("{\"child\":");
- TestXmlRescursive msg = TestXmlRescursive.ParseFromJson(sb.ToString());
+ TestXmlRescursive msg = new TestXmlRescursive.Builder().MergeFromJson(sb.ToString()).Build();
}
[Test, ExpectedException(typeof(FormatException))]
public void FailWithEmptyText()
diff --git a/src/ProtocolBuffers.Test/TestWriterFormatXml.cs b/src/ProtocolBuffers.Test/TestWriterFormatXml.cs
index acad6f13..2ffca9fb 100644
--- a/src/ProtocolBuffers.Test/TestWriterFormatXml.cs
+++ b/src/ProtocolBuffers.Test/TestWriterFormatXml.cs
@@ -18,7 +18,7 @@ namespace Google.ProtocolBuffers
TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build();
string xml = msg.ToXml();
Assert.AreEqual("<root><default_bool>true</default_bool></root>", xml);
- TestAllTypes copy = TestAllTypes.ParseFromXml(XmlReader.Create(new StringReader(xml)));
+ TestAllTypes copy = new TestAllTypes.Builder().MergeFromXml(XmlReader.Create(new StringReader(xml))).Build();
Assert.IsTrue(copy.HasDefaultBool && copy.DefaultBool);
Assert.AreEqual(msg, copy);
}
@@ -29,7 +29,7 @@ namespace Google.ProtocolBuffers
TestAllTypes msg = new TestAllTypes.Builder().SetDefaultBool(true).Build();
string xml = msg.ToXml("message");
Assert.AreEqual("<message><default_bool>true</default_bool></message>", xml);
- TestAllTypes copy = TestAllTypes.ParseFromXml("message", XmlReader.Create(new StringReader(xml)));
+ TestAllTypes copy = new TestAllTypes.Builder().MergeFromXml("message", XmlReader.Create(new StringReader(xml))).Build();
Assert.IsTrue(copy.HasDefaultBool && copy.DefaultBool);
Assert.AreEqual(msg, copy);
}
@@ -324,13 +324,13 @@ namespace Google.ProtocolBuffers
TestXmlMessage copy = rdr.Merge(TestXmlMessage.CreateBuilder(), registry).Build();
Assert.AreEqual(message, copy);
}
- [Test, ExpectedException(typeof(InvalidProtocolBufferException))]
+ [Test, ExpectedException(typeof(RecursionLimitExceededException))]
public void TestRecursiveLimit()
{
StringBuilder sb = new StringBuilder(8192);
for (int i = 0; i < 80; i++)
sb.Append("<child>");
- TestXmlRescursive msg = TestXmlRescursive.ParseFromXml("child", XmlReader.Create(new StringReader(sb.ToString())));
+ TestXmlRescursive msg = new TestXmlRescursive.Builder().MergeFromXml("child", XmlReader.Create(new StringReader(sb.ToString()))).Build();
}
}
}
diff --git a/src/ProtocolBuffers.sln b/src/ProtocolBuffers.sln
index a7323db1..04e1c9cd 100644
--- a/src/ProtocolBuffers.sln
+++ b/src/ProtocolBuffers.sln
@@ -1,5 +1,4 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
+Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "proto", "proto", "{1F896D5C-5FC2-4671-9216-781CB8187EC7}"
ProjectSection(SolutionItems) = preProject
@@ -67,6 +66,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{66ED1950
..\build\RunBenchmarks.bat = ..\build\RunBenchmarks.bat
EndProjectSection
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.csproj", "{231391AF-449C-4a39-986C-AD7F270F4750}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_Silverlight2|Any CPU = Debug_Silverlight2|Any CPU
@@ -145,6 +146,14 @@ Global
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU
+ {231391AF-449C-4a39-986C-AD7F270F4750}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug_Silverlight2|Any CPU
+ {231391AF-449C-4a39-986C-AD7F270F4750}.Debug_Silverlight2|Any CPU.Build.0 = Debug_Silverlight2|Any CPU
+ {231391AF-449C-4a39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {231391AF-449C-4a39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {231391AF-449C-4a39-986C-AD7F270F4750}.Release_Silverlight2|Any CPU.ActiveCfg = Release_Silverlight2|Any CPU
+ {231391AF-449C-4a39-986C-AD7F270F4750}.Release_Silverlight2|Any CPU.Build.0 = Release_Silverlight2|Any CPU
+ {231391AF-449C-4a39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {231391AF-449C-4a39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/src/ProtocolBuffers/AbstractMessage.cs b/src/ProtocolBuffers/AbstractMessage.cs
index 0c898c70..13443b1c 100644
--- a/src/ProtocolBuffers/AbstractMessage.cs
+++ b/src/ProtocolBuffers/AbstractMessage.cs
@@ -40,7 +40,6 @@ using System.IO;
using System.Text;
using Google.ProtocolBuffers.Collections;
using Google.ProtocolBuffers.Descriptors;
-using Google.ProtocolBuffers.Serialization;
namespace Google.ProtocolBuffers
{
@@ -123,27 +122,6 @@ namespace Google.ProtocolBuffers
return TextFormat.PrintToString(this);
}
- public string ToJson()
- {
- JsonFormatWriter w = JsonFormatWriter.CreateInstance();
- w.WriteMessage(this);
- return w.ToString();
- }
-
- public string ToXml()
- {
- StringWriter w = new StringWriter(new StringBuilder(4096));
- XmlFormatWriter.CreateInstance(w).WriteMessage(this);
- return w.ToString();
- }
-
- public string ToXml(string rootElementName)
- {
- StringWriter w = new StringWriter(new StringBuilder(4096));
- XmlFormatWriter.CreateInstance(w).WriteMessage(rootElementName, this);
- return w.ToString();
- }
-
public override sealed void PrintTo(TextWriter writer)
{
TextFormat.Print(this, writer);
diff --git a/src/ProtocolBuffers/GeneratedMessage.cs b/src/ProtocolBuffers/GeneratedMessage.cs
index 8147a88b..ce755bed 100644
--- a/src/ProtocolBuffers/GeneratedMessage.cs
+++ b/src/ProtocolBuffers/GeneratedMessage.cs
@@ -42,7 +42,6 @@ using System.Xml;
using Google.ProtocolBuffers.Collections;
using Google.ProtocolBuffers.Descriptors;
using Google.ProtocolBuffers.FieldAccess;
-using Google.ProtocolBuffers.Serialization;
namespace Google.ProtocolBuffers
{
@@ -178,42 +177,5 @@ namespace Google.ProtocolBuffers
{
unknownFields = fieldSet;
}
-
- public static TMessage ParseFromJson(string jsonText)
- {
- return JsonFormatReader.CreateInstance(jsonText)
- .Merge(new TBuilder())
- .Build();
- }
-
- public static TMessage ParseFromJson(TextReader reader)
- {
- return ParseFromJson(reader, ExtensionRegistry.Empty);
- }
-
- public static TMessage ParseFromJson(TextReader reader, ExtensionRegistry extensionRegistry)
- {
- return JsonFormatReader.CreateInstance(reader)
- .Merge(new TBuilder(), extensionRegistry)
- .Build();
- }
-
- public static TMessage ParseFromXml(XmlReader reader)
- {
- return ParseFromXml(XmlFormatReader.DefaultRootElementName, reader, ExtensionRegistry.Empty);
- }
-
- public static TMessage ParseFromXml(string rootElementName, XmlReader reader)
- {
- return ParseFromXml(rootElementName, reader, ExtensionRegistry.Empty);
- }
-
- public static TMessage ParseFromXml(string rootElementName, XmlReader reader,
- ExtensionRegistry extensionRegistry)
- {
- return XmlFormatReader.CreateInstance(reader)
- .Merge(rootElementName, new TBuilder(), extensionRegistry)
- .Build();
- }
}
} \ No newline at end of file
diff --git a/src/ProtocolBuffers/IMessage.cs b/src/ProtocolBuffers/IMessage.cs
index 514c4bf8..c23bc3f7 100644
--- a/src/ProtocolBuffers/IMessage.cs
+++ b/src/ProtocolBuffers/IMessage.cs
@@ -185,24 +185,6 @@ namespace Google.ProtocolBuffers
new byte[] ToByteArray();
/// <summary>
- /// Serializes the message to JSON text. This is a trivial wrapper
- /// around Serialization.JsonFormatWriter.WriteMessage.
- /// </summary>
- string ToJson();
-
- /// <summary>
- /// Serializes the message to XML text. This is a trivial wrapper
- /// around Serialization.XmlFormatWriter.WriteMessage.
- /// </summary>
- string ToXml();
-
- /// <summary>
- /// Serializes the message to XML text using the element name provided.
- /// This is a trivial wrapper around Serialization.XmlFormatWriter.WriteMessage.
- /// </summary>
- string ToXml(string rootElementName);
-
- /// <summary>
/// Serializes the message and writes it to the given stream.
/// This is just a wrapper around WriteTo(ICodedOutputStream). This
/// does not flush or close the stream.
diff --git a/src/ProtocolBuffers/ProtocolBuffers.csproj b/src/ProtocolBuffers/ProtocolBuffers.csproj
index d278d8a3..336b387f 100644
--- a/src/ProtocolBuffers/ProtocolBuffers.csproj
+++ b/src/ProtocolBuffers/ProtocolBuffers.csproj
@@ -88,7 +88,6 @@
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" />
- <Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
@@ -181,19 +180,6 @@
<Compile Include="NameHelpers.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RpcUtil.cs" />
- <Compile Include="Serialization\AbstractReader.cs" />
- <Compile Include="Serialization\AbstractTextReader.cs" />
- <Compile Include="Serialization\AbstractTextWriter.cs" />
- <Compile Include="Serialization\AbstractWriter.cs" />
- <Compile Include="Serialization\DictionaryReader.cs" />
- <Compile Include="Serialization\DictionaryWriter.cs" />
- <Compile Include="Serialization\JsonFormatReader.cs" />
- <Compile Include="Serialization\JsonFormatWriter.cs" />
- <Compile Include="Serialization\JsonTextCursor.cs" />
- <Compile Include="Serialization\XmlFormatReader.cs" />
- <Compile Include="Serialization\XmlFormatWriter.cs" />
- <Compile Include="Serialization\XmlReaderOptions.cs" />
- <Compile Include="Serialization\XmlWriterOptions.cs" />
<Compile Include="SilverlightCompatibility.cs" />
<Compile Include="SortedList.cs" />
<Compile Include="TextFormat.cs" />
diff --git a/src/ProtocolBuffers2008.sln b/src/ProtocolBuffers2008.sln
index 8172c7b9..fc0bf81d 100644
--- a/src/ProtocolBuffers2008.sln
+++ b/src/ProtocolBuffers2008.sln
@@ -67,6 +67,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{66ED1950
..\build\RunBenchmarks.bat = ..\build\RunBenchmarks.bat
EndProjectSection
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.csproj", "{231391AF-449C-4a39-986C-AD7F270F4750}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_Silverlight2|Any CPU = Debug_Silverlight2|Any CPU
@@ -145,6 +147,14 @@ Global
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release_Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU
+ {231391AF-449C-4a39-986C-AD7F270F4750}.Debug_Silverlight2|Any CPU.ActiveCfg = Debug_Silverlight2|Any CPU
+ {231391AF-449C-4a39-986C-AD7F270F4750}.Debug_Silverlight2|Any CPU.Build.0 = Debug_Silverlight2|Any CPU
+ {231391AF-449C-4a39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {231391AF-449C-4a39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {231391AF-449C-4a39-986C-AD7F270F4750}.Release_Silverlight2|Any CPU.ActiveCfg = Release_Silverlight2|Any CPU
+ {231391AF-449C-4a39-986C-AD7F270F4750}.Release_Silverlight2|Any CPU.Build.0 = Release_Silverlight2|Any CPU
+ {231391AF-449C-4a39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {231391AF-449C-4a39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE