简体   繁体   English

如何在 Windows 下在 Mono 上构建 protobuf-csharp-port

[英]How to build protobuf-csharp-port on Mono under Windows

I've read the instruction for building protobuf-csharp-port using Mono under Linux/Unix system.我已经阅读了在Linux/Unix系统下使用Mono构建protobuf-csharp-port的说明。 I still can't get it work and eventually I'll open a thread to ask why, but that's not the question of this post.我仍然无法让它工作,最终我会打开一个线程来询问原因,但这不是这篇文章的问题。

I'm using Windows to develop and I have successfully built protobuf-csharp-port using VS2010 .我正在使用Windows进行开发,并且已经使用VS2010成功构建了 protobuf-csharp-port 。 The fact is that I need to use the generated C# classes from inside Unity3D , which requires to use Mono.事实是,我需要使用Unity3D内部生成的 C# 类,这需要使用 Mono。

I have Mono 2.8 installed on my machine.我的机器上安装了Mono 2.8

The question is:问题是:

is possible to build protobuf-csharp-port in Windows using MonoDevelop ?可以使用MonoDevelop在 Windows 中构建protobuf-csharp-port吗? I tried to simply import the VS2010 solution and compile it using Mono but it doesn't works.我试图简单地导入 VS2010 解决方案并使用 Mono 编译它,但它不起作用。

How can I do it?我该怎么做?

EDIT编辑

While trying to simply compile VS solution using MonoDevelop I got several errors.在尝试使用 MonoDevelop 简单地编译 VS 解决方案时,我遇到了几个错误。 The first is in the following line of FieldMappingAttribute.cs :第一个位于FieldMappingAttribute.cs的以下行中:

 public MappedType MappedType { get; private set; }

The error is the following:错误如下:

FieldMappingAttribute.cs(40,40): Error CS0501: 'Google.ProtocolBuffers.Descriptors.FieldMappingAttribute.MappedType.get' must declare a body because it is not marked abstract or extern (CS0501) (ProtocolBuffers) FieldMappingAttribute.cs(40,40): 错误 CS0501: 'Google.ProtocolBuffers.Descriptors.FieldMappingAttribute.MappedType.get' 必须声明一个主体,因为它没有被标记为抽象或外部 (CS0501) (ProtocolBuffers)

You shouldn't need to build the main protobuf-csharp-port project yourself... or if you do, you should be able to do that very rarely.您不需要自己构建主要的 protobuf-csharp-port 项目……或者如果您这样做,您应该很少这样做。

You don't need to rebuild protobuf-csharp-port just to build the generated C# classes.不需要为了构建生成的 C# 类而重建 protobuf-csharp-port。 Just add a reference to Google.ProtocolBuffers.dll, and you should be fine.只需添加对 Google.ProtocolBuffers.dll 的引用,就可以了。

That said, I haven't tested it on Mono for a while.也就是说,我已经有一段时间没有在 Mono 上测试过它了。 It doesn't do anything desperately tricky, but you should definitely test thoroughly.它不会做任何非常棘手的事情,但你绝对应该彻底测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 protobuf的-CSHARP端口 - protobuf-csharp-port protobuf-csharp-port 和 protobuf-net 如何选择 - How to choose between protobuf-csharp-port and protobuf-net protobuf-csharp-port是否支持Windows RT? - Does protobuf-csharp-port support Windows RT? 是否可以在protobuf-csharp-port中检测消息类型? - Is it possible to detect message type in protobuf-csharp-port? 使用带有protobuf-csharp-port的文件记录和重播人类可读的protobuf消息 - Record and replay human-readable protobuf messages using a file with protobuf-csharp-port 有没有办法将protobuf-csharp-port生成的类与servicestack.ormlite一起使用? - Is there way to use protobuf-csharp-port generated classes with servicestack.ormlite? protobuf-csharp-port这些工具最适合今天使用什么版本? - protobuf-csharp-port what version(s) of these tools are best to use today? protobuf-csharp-port-来自文件的流记录有点像LINQ-to-XML中的轴函数 - protobuf-csharp-port - streaming records from a file a bit like an axis function in LINQ-to-XML 协议缓冲区-protobuf-csharp-port:是否存在等效的JAVA API调用CodedInputStream.getBytesUntilLimit()? - Protocol Buffers - protobuf-csharp-port : Does the equivalent of JAVA API call CodedInputStream.getBytesUntilLimit() exist? 在Windows下构建mono 2.8 - Building mono 2.8 under Windows
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM