aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/Google.Protobuf
diff options
context:
space:
mode:
Diffstat (limited to 'csharp/src/Google.Protobuf')
-rw-r--r--csharp/src/Google.Protobuf/Google.Protobuf.csproj10
-rw-r--r--csharp/src/Google.Protobuf/Google.Protobuf.nuspec57
-rw-r--r--csharp/src/Google.Protobuf/JsonFormatter.cs54
-rw-r--r--csharp/src/Google.Protobuf/Reflection/Descriptor.cs44
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/Any.cs2
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/Api.cs6
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs2
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs2
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs2
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs2
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs6
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs2
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/Type.cs10
-rw-r--r--csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs18
-rw-r--r--csharp/src/Google.Protobuf/packages.config4
15 files changed, 151 insertions, 70 deletions
diff --git a/csharp/src/Google.Protobuf/Google.Protobuf.csproj b/csharp/src/Google.Protobuf/Google.Protobuf.csproj
index 36807b82..e6af2483 100644
--- a/csharp/src/Google.Protobuf/Google.Protobuf.csproj
+++ b/csharp/src/Google.Protobuf/Google.Protobuf.csproj
@@ -16,6 +16,8 @@
<FileAlignment>512</FileAlignment>
<OldToolsVersion>3.5</OldToolsVersion>
<MinimumVisualStudioVersion>10.0</MinimumVisualStudioVersion>
+ <NuGetPackageImportStamp>
+ </NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -142,9 +144,17 @@
</ItemGroup>
<ItemGroup>
<None Include="Google.Protobuf.nuspec" />
+ <None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
+ <Import Project="..\packages\NuSpec.ReferenceGenerator.1.4.1\build\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NuSpec.ReferenceGenerator.targets" Condition="Exists('..\packages\NuSpec.ReferenceGenerator.1.4.1\build\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NuSpec.ReferenceGenerator.targets')" />
+ <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+ <PropertyGroup>
+ <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+ </PropertyGroup>
+ <Error Condition="!Exists('..\packages\NuSpec.ReferenceGenerator.1.4.1\build\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NuSpec.ReferenceGenerator.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NuSpec.ReferenceGenerator.1.4.1\build\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NuSpec.ReferenceGenerator.targets'))" />
+ </Target>
<!-- 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">
diff --git a/csharp/src/Google.Protobuf/Google.Protobuf.nuspec b/csharp/src/Google.Protobuf/Google.Protobuf.nuspec
index 9542138a..2f691e3c 100644
--- a/csharp/src/Google.Protobuf/Google.Protobuf.nuspec
+++ b/csharp/src/Google.Protobuf/Google.Protobuf.nuspec
@@ -1,11 +1,11 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<package>
<metadata>
<id>Google.Protobuf</id>
<title>Google Protocol Buffers C#</title>
<summary>C# runtime library for Protocol Buffers - Google's data interchange format.</summary>
<description>See project site for more info.</description>
- <version>3.0.0-alpha4</version>
+ <version>3.0.0-beta2</version>
<authors>Google Inc.</authors>
<owners>protobuf-packages</owners>
<licenseUrl>https://github.com/google/protobuf/blob/master/LICENSE</licenseUrl>
@@ -14,24 +14,43 @@
<releaseNotes>C# proto3 support</releaseNotes>
<copyright>Copyright 2015, Google Inc.</copyright>
<tags>Protocol Buffers Binary Serialization Format Google proto proto3</tags>
+ <dependencies>
+ <group targetFramework="dotnet">
+ <dependency id="System.Collections" version="4.0.0" />
+ <dependency id="System.Diagnostics.Debug" version="4.0.0" />
+ <dependency id="System.Globalization" version="4.0.0" />
+ <dependency id="System.IO" version="4.0.0" />
+ <dependency id="System.Linq" version="4.0.0" />
+ <dependency id="System.Linq.Expressions" version="4.0.0" />
+ <dependency id="System.ObjectModel" version="4.0.0" />
+ <dependency id="System.Reflection" version="4.0.0" />
+ <dependency id="System.Runtime" version="4.0.0" />
+ <dependency id="System.Runtime.Extensions" version="4.0.0" />
+ <dependency id="System.Text.Encoding" version="4.0.0" />
+ <dependency id="System.Text.RegularExpressions" version="4.0.0" />
+ </group>
+ </dependencies>
</metadata>
<files>
<file src="bin/ReleaseSigned/Google.Protobuf.dll" target="lib/portable-net45+netcore45+wpa81+wp8" />
- <file src="bin/ReleaseSigned/Google.Protobuf.pdb" target="lib/portable-net45+netcore45+wpa81+wp8" />
- <file src="bin/ReleaseSigned/Google.Protobuf.xml" target="lib/portable-net45+netcore45+wpa81+wp8" />
- <file src="**\*.cs" target="src" />
- <file src="..\..\..\cmake\Release\protoc.exe" target="tools" />
- <file src="..\..\..\src\google\protobuf\any.proto" target="tools\google\protobuf" />
- <file src="..\..\..\src\google\protobuf\api.proto" target="tools\google\protobuf" />
- <file src="..\..\..\src\google\protobuf\descriptor.proto" target="tools\google\protobuf" />
- <file src="..\..\..\src\google\protobuf\duration.proto" target="tools\google\protobuf" />
- <file src="..\..\..\src\google\protobuf\empty.proto" target="tools\google\protobuf" />
- <file src="..\..\..\src\google\protobuf\field_mask.proto" target="tools\google\protobuf" />
- <file src="..\..\..\src\google\protobuf\source_context.proto" target="tools\google\protobuf" />
- <file src="..\..\..\src\google\protobuf\struct.proto" target="tools\google\protobuf" />
- <file src="..\..\..\src\google\protobuf\timestamp.proto" target="tools\google\protobuf" />
- <file src="..\..\..\src\google\protobuf\any.proto" target="tools\google\protobuf" />
- <file src="..\..\..\src\google\protobuf\type.proto" target="tools\google\protobuf" />
- <file src="..\..\..\src\google\protobuf\wrappers.proto" target="tools\google\protobuf" />
+ <file src="bin/ReleaseSigned/Google.Protobuf.pdb" target="lib/portable-net45+netcore45+wpa81+wp8" />
+ <file src="bin/ReleaseSigned/Google.Protobuf.xml" target="lib/portable-net45+netcore45+wpa81+wp8" />
+ <file src="bin/ReleaseSigned/Google.Protobuf.dll" target="lib/dotnet" />
+ <file src="bin/ReleaseSigned/Google.Protobuf.pdb" target="lib/dotnet" />
+ <file src="bin/ReleaseSigned/Google.Protobuf.xml" target="lib/dotnet" />
+ <file src="**\*.cs" target="src" />
+ <file src="..\..\..\cmake\Release\protoc.exe" target="tools" />
+ <file src="..\..\..\src\google\protobuf\any.proto" target="tools\google\protobuf" />
+ <file src="..\..\..\src\google\protobuf\api.proto" target="tools\google\protobuf" />
+ <file src="..\..\..\src\google\protobuf\descriptor.proto" target="tools\google\protobuf" />
+ <file src="..\..\..\src\google\protobuf\duration.proto" target="tools\google\protobuf" />
+ <file src="..\..\..\src\google\protobuf\empty.proto" target="tools\google\protobuf" />
+ <file src="..\..\..\src\google\protobuf\field_mask.proto" target="tools\google\protobuf" />
+ <file src="..\..\..\src\google\protobuf\source_context.proto" target="tools\google\protobuf" />
+ <file src="..\..\..\src\google\protobuf\struct.proto" target="tools\google\protobuf" />
+ <file src="..\..\..\src\google\protobuf\timestamp.proto" target="tools\google\protobuf" />
+ <file src="..\..\..\src\google\protobuf\any.proto" target="tools\google\protobuf" />
+ <file src="..\..\..\src\google\protobuf\type.proto" target="tools\google\protobuf" />
+ <file src="..\..\..\src\google\protobuf\wrappers.proto" target="tools\google\protobuf" />
</files>
-</package>
+</package> \ No newline at end of file
diff --git a/csharp/src/Google.Protobuf/JsonFormatter.cs b/csharp/src/Google.Protobuf/JsonFormatter.cs
index 45941b39..7b99f314 100644
--- a/csharp/src/Google.Protobuf/JsonFormatter.cs
+++ b/csharp/src/Google.Protobuf/JsonFormatter.cs
@@ -56,17 +56,19 @@ namespace Google.Protobuf
public sealed class JsonFormatter
{
internal const string AnyTypeUrlField = "@type";
+ internal const string AnyDiagnosticValueField = "@value";
internal const string AnyWellKnownTypeValueField = "value";
private const string TypeUrlPrefix = "type.googleapis.com";
private const string NameValueSeparator = ": ";
private const string PropertySeparator = ", ";
- private static JsonFormatter defaultInstance = new JsonFormatter(Settings.Default);
-
/// <summary>
/// Returns a formatter using the default settings.
/// </summary>
- public static JsonFormatter Default { get { return defaultInstance; } }
+ public static JsonFormatter Default { get; } = new JsonFormatter(Settings.Default);
+
+ // A JSON formatter which *only* exists
+ private static readonly JsonFormatter diagnosticFormatter = new JsonFormatter(Settings.Default);
/// <summary>
/// The JSON representation of the first 160 characters of Unicode.
@@ -149,6 +151,29 @@ namespace Google.Protobuf
return builder.ToString();
}
+ /// <summary>
+ /// Converts a message to JSON for diagnostic purposes with no extra context.
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// This differs from calling <see cref="Format(IMessage)"/> on the default JSON
+ /// formatter in its handling of <see cref="Any"/>. As no type registry is available
+ /// in <see cref="object.ToString"/> calls, the normal way of resolving the type of
+ /// an <c>Any</c> message cannot be applied. Instead, a JSON property named <c>@value</c>
+ /// is included with the base64 data from the <see cref="Any.Value"/> property of the message.
+ /// </para>
+ /// <para>The value returned by this method is only designed to be used for diagnostic
+ /// purposes. It may not be parsable by <see cref="JsonParser"/>, and may not be parsable
+ /// by other Protocol Buffer implementations.</para>
+ /// </remarks>
+ /// <param name="message">The message to format for diagnostic purposes.</param>
+ /// <returns>The diagnostic-only JSON representation of the message</returns>
+ public static string ToDiagnosticString(IMessage message)
+ {
+ Preconditions.CheckNotNull(message, nameof(message));
+ return diagnosticFormatter.Format(message);
+ }
+
private void WriteMessage(StringBuilder builder, IMessage message)
{
if (message == null)
@@ -516,6 +541,12 @@ namespace Google.Protobuf
private void WriteAny(StringBuilder builder, IMessage value)
{
+ if (ReferenceEquals(this, diagnosticFormatter))
+ {
+ WriteDiagnosticOnlyAny(builder, value);
+ return;
+ }
+
string typeUrl = (string) value.Descriptor.Fields[Any.TypeUrlFieldNumber].Accessor.GetValue(value);
ByteString data = (ByteString) value.Descriptor.Fields[Any.ValueFieldNumber].Accessor.GetValue(value);
string typeName = GetTypeName(typeUrl);
@@ -544,6 +575,23 @@ namespace Google.Protobuf
builder.Append(" }");
}
+ private void WriteDiagnosticOnlyAny(StringBuilder builder, IMessage value)
+ {
+ string typeUrl = (string) value.Descriptor.Fields[Any.TypeUrlFieldNumber].Accessor.GetValue(value);
+ ByteString data = (ByteString) value.Descriptor.Fields[Any.ValueFieldNumber].Accessor.GetValue(value);
+ builder.Append("{ ");
+ WriteString(builder, AnyTypeUrlField);
+ builder.Append(NameValueSeparator);
+ WriteString(builder, typeUrl);
+ builder.Append(PropertySeparator);
+ WriteString(builder, AnyDiagnosticValueField);
+ builder.Append(NameValueSeparator);
+ builder.Append('"');
+ builder.Append(data.ToBase64());
+ builder.Append('"');
+ builder.Append(" }");
+ }
+
internal static string GetTypeName(String typeUrl)
{
string[] parts = typeUrl.Split('/');
diff --git a/csharp/src/Google.Protobuf/Reflection/Descriptor.cs b/csharp/src/Google.Protobuf/Reflection/Descriptor.cs
index 03685322..d29424ad 100644
--- a/csharp/src/Google.Protobuf/Reflection/Descriptor.cs
+++ b/csharp/src/Google.Protobuf/Reflection/Descriptor.cs
@@ -225,7 +225,7 @@ namespace Google.Protobuf.Reflection {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -489,7 +489,7 @@ namespace Google.Protobuf.Reflection {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -827,7 +827,7 @@ namespace Google.Protobuf.Reflection {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -1021,7 +1021,7 @@ namespace Google.Protobuf.Reflection {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -1162,7 +1162,7 @@ namespace Google.Protobuf.Reflection {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -1436,7 +1436,7 @@ namespace Google.Protobuf.Reflection {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -1741,7 +1741,7 @@ namespace Google.Protobuf.Reflection {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -1872,7 +1872,7 @@ namespace Google.Protobuf.Reflection {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -2031,7 +2031,7 @@ namespace Google.Protobuf.Reflection {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -2196,7 +2196,7 @@ namespace Google.Protobuf.Reflection {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -2404,7 +2404,7 @@ namespace Google.Protobuf.Reflection {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -2863,7 +2863,7 @@ namespace Google.Protobuf.Reflection {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -3302,7 +3302,7 @@ namespace Google.Protobuf.Reflection {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -3596,7 +3596,7 @@ namespace Google.Protobuf.Reflection {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -3845,7 +3845,7 @@ namespace Google.Protobuf.Reflection {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -3990,7 +3990,7 @@ namespace Google.Protobuf.Reflection {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -4121,7 +4121,7 @@ namespace Google.Protobuf.Reflection {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -4252,7 +4252,7 @@ namespace Google.Protobuf.Reflection {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -4451,7 +4451,7 @@ namespace Google.Protobuf.Reflection {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -4653,7 +4653,7 @@ namespace Google.Protobuf.Reflection {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -4823,7 +4823,7 @@ namespace Google.Protobuf.Reflection {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -5051,7 +5051,7 @@ namespace Google.Protobuf.Reflection {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs
index 0b830b66..efa60a68 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs
@@ -165,7 +165,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs
index e9330e69..1b925b9c 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs
@@ -230,7 +230,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -503,7 +503,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -783,7 +783,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs
index 42fda452..4eeff4f0 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs
@@ -164,7 +164,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs
index 92bc0397..d568a811 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs
@@ -94,7 +94,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs b/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs
index 963b72be..0cd5952a 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs
@@ -221,7 +221,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs b/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs
index d5385642..2972b346 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs
@@ -105,7 +105,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs
index 73e3cae2..a811ea8b 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs
@@ -136,7 +136,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -361,7 +361,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -555,7 +555,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs
index 499b0950..adee4bb4 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs
@@ -175,7 +175,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs
index ef368bd3..a76d02b4 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs
@@ -230,7 +230,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -522,7 +522,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -910,7 +910,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -1098,7 +1098,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -1244,7 +1244,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs
index a70b2fb0..43148772 100644
--- a/csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs
+++ b/csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs
@@ -117,7 +117,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -228,7 +228,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -339,7 +339,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -450,7 +450,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -561,7 +561,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -672,7 +672,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -783,7 +783,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -894,7 +894,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
@@ -1005,7 +1005,7 @@ namespace Google.Protobuf.WellKnownTypes {
}
public override string ToString() {
- return pb::JsonFormatter.Default.Format(this);
+ return pb::JsonFormatter.ToDiagnosticString(this);
}
public void WriteTo(pb::CodedOutputStream output) {
diff --git a/csharp/src/Google.Protobuf/packages.config b/csharp/src/Google.Protobuf/packages.config
new file mode 100644
index 00000000..40b8fd92
--- /dev/null
+++ b/csharp/src/Google.Protobuf/packages.config
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="NuSpec.ReferenceGenerator" version="1.4.1" targetFramework="portable45-net45+win8+wp8+wpa81" developmentDependency="true" />
+</packages> \ No newline at end of file