diff --git a/src/google/protobuf/compiler/csharp/csharp_message.cc b/src/google/protobuf/compiler/csharp/csharp_message.cc index 7156c9e5b6..66b8c2d5e0 100644 --- a/src/google/protobuf/compiler/csharp/csharp_message.cc +++ b/src/google/protobuf/compiler/csharp/csharp_message.cc @@ -181,6 +181,7 @@ void MessageGenerator::Generate(Writer* writer) { descriptor_->extension_range_count() > 0 ? "Extendable" : "Generated", runtime_suffix()); writer->Indent(); + writer->WriteLine("private $0$() { }", class_name()); // Private ctor. // Must call MakeReadOnly() to make sure all lists are made read-only writer->WriteLine( "private static readonly $0$ defaultInstance = new $0$().MakeReadOnly();",