diff --git a/csharp/src/Google.Protobuf/CodedInputStream.cs b/csharp/src/Google.Protobuf/CodedInputStream.cs
index 82c6ceab92..65d0e710d3 100644
--- a/csharp/src/Google.Protobuf/CodedInputStream.cs
+++ b/csharp/src/Google.Protobuf/CodedInputStream.cs
@@ -38,7 +38,7 @@ using System.IO;
namespace Google.Protobuf
{
///
- /// Readings and decodes protocol message fields.
+ /// Reads and decodes protocol message fields.
///
///
///
diff --git a/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs
index 901cbf47a5..619a6ac8ad 100644
--- a/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs
+++ b/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs
@@ -252,7 +252,7 @@ namespace Google.Protobuf.Reflection
{
if (fieldType != FieldType.Message)
{
- throw new InvalidOperationException("MessageType is only valid for enum fields.");
+ throw new InvalidOperationException("MessageType is only valid for message fields.");
}
return messageType;
}
diff --git a/src/google/protobuf/compiler/csharp/csharp_message.cc b/src/google/protobuf/compiler/csharp/csharp_message.cc
index a71a7909fc..a2c4fe5729 100644
--- a/src/google/protobuf/compiler/csharp/csharp_message.cc
+++ b/src/google/protobuf/compiler/csharp/csharp_message.cc
@@ -169,6 +169,7 @@ void MessageGenerator::Generate(io::Printer* printer) {
printer->Print(
vars,
"private object $name$_;\n"
+ "/// Enum of possibly cases for the \"$original_name$\" oneof.\n"
"public enum $property_name$OneofCase {\n");
printer->Indent();
printer->Print("None = 0,\n");
@@ -202,7 +203,10 @@ void MessageGenerator::Generate(io::Printer* printer) {
printer->Print("#region Nested types\n"
"[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n");
WriteGeneratedCodeAttributes(printer);
- printer->Print("public static partial class Types {\n");
+ printer->Print(
+ vars,
+ "/// Container for nested types declared in the $class_name$ message type.\n"
+ "public static partial class Types {\n");
printer->Indent();
for (int i = 0; i < descriptor_->enum_type_count(); i++) {
EnumGenerator enumGenerator(descriptor_->enum_type(i));
diff --git a/src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc b/src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc
index 4b347708c9..b7328f9a56 100644
--- a/src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc
+++ b/src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc
@@ -138,8 +138,10 @@ void UmbrellaClassGenerator::WriteIntroduction(io::Printer* printer) {
"[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n");
WriteGeneratedCodeAttributes(printer);
printer->Print(
+ "/// Holder for reflection information generated from $file_name$\n"
"$access_level$ static partial class $umbrella_class_name$ {\n"
"\n",
+ "file_name", file_->name(),
"access_level", class_access_level(),
"umbrella_class_name", umbrellaClassname_);
printer->Indent();
@@ -148,12 +150,14 @@ void UmbrellaClassGenerator::WriteIntroduction(io::Printer* printer) {
void UmbrellaClassGenerator::WriteDescriptor(io::Printer* printer) {
printer->Print(
"#region Descriptor\n"
+ "/// File descriptor for $file_name$\n"
"public static pbr::FileDescriptor Descriptor {\n"
" get { return descriptor; }\n"
"}\n"
"private static pbr::FileDescriptor descriptor;\n"
"\n"
"static $umbrella_class_name$() {\n",
+ "file_name", file_->name(),
"umbrella_class_name", umbrellaClassname_);
printer->Indent();
printer->Print(