Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 726031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:24:19+00:00 2026-05-14T06:24:19+00:00

I am using the latest version of protobuf-net with VS2008 integration. I have created

  • 0

I am using the latest version of protobuf-net with VS2008 integration. I have created 2 messages (Message1 and Message2), 1 message in 1 proto file. When I try to reference Message2 in Message1 the code generator tool gives me error “Message2” is not defined and won’t generate the code file. The package for both messages is same.
It look like that because of the integration of the tool with VS2008 it expects all the messages in same .proto file to compile. Currently I have to paste an empty message with same name in Message1.proto file, like this:

message Message1 {
 optional Message2 message2 = 1;
}

message Message2 {
}

And then later on remove the declaration of class Message2 from Message1.cs.
Are there any settings that I need to do so to avoid this error, or is providing an empty declaration the only way?
Or if there isn’t then I suggest that you (Marc Gravell) include a keyword like “extern” to tell the compiler that the definition of this type is available in another class

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T06:24:20+00:00Added an answer on May 14, 2026 at 6:24 am

    I have:

    (File1.proto)

    import "File2.proto";
    message Message1 {
     optional Message2 message2 = 1;
    }
    

    (File2.proto)

    message Message2 {
    }
    

    Each decorated (in the IDE) with the custom tool (ProtoBufTool) and it is working fine. Two .cs files are generated, one each nested under the File*.proto files, with the necessary generated types in each.

    Have I missed something? I guess I could make the first file (alone) generate the types from the imported files, but to do that I’d actually need to write a parser from scratch (at the moment it uses google’s .proto parser under the hood).

    Re changing the language – that isn’t up to me; but do you simply mean the (existing) import declaration?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the latest version of Resharper (4.5.x) with VS2008. Every now and then (pretty
I was using a version of v2 of protobuf-net from a few weeks ago
I am using the latest version of boost and boost.asio. I have this class:
I am using the latest version Telerik MVC controls . I am using ASP.NET
I am using the latest version of Telerik MVC controls on my ASP.NET MVC3
I am using the latest version of Twitter Bootstrap on a project. I have
I am using the latest version of MySQL 5.5. I have a fulltext index
I am using the latest version of MySQL connector to .NET and Visual Studio
Im using latest TCPDF version(5.9). But have some strange problems with encoding. I need
i am using the latest version of automapping and FNH with vs2008, i got

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.