我正在使用protobuf-net来序列化我的数据。在Windows下一切正常,我使用Mono在Linux下运行示例项目,但看起来并不简单。protobuf-net + Mono + Linux
我收到以下错误:
Missing method Skip in assembly /home/***/Debug/Di3.dll, type System.Linq.Enumerable Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
唯一的例外是在下面的行抛出:
var instance = new ToSerializeClass();
和类中定义为:
[ProtoContract]
public class ToSerializeClass
{
internal ToSerializeClass()
{// it seems that the protobuf net needs this constructor.
}
[ProtoMember(1)]
internal int omega { set; get; }
[ProtoMember(2)]
internal List<Lambda> lambda { set; get; }
}
我复制调试/将文件夹部署到linux,用o替换protobuf-net.dll
和protobuf-net.xml
nes已发布为Mono
,并使用Mono
致电我的程序。
我在这里错过了什么观点吗?
我可能是错的,但我很确定protobuf-net *不使用* LINQ。有一个3.0版本(WCF支持),但我从来没有发布引用LINQ(3.5,不包括LinqBridge)的版本,因为我不需要这些工具。你确定问题出在你认为的地方吗?我也很困惑你为什么在构建之后交换DLL。这听起来彻底坏主意。你想在那里做什么? – 2014-10-12 15:01:00
@MarcGravell我很确定上述的例外情况。关于你的最后一点,我也为Linux构建了适当的protobuf-net,但仍然收到同样的错误。 – Hamed 2014-10-12 15:58:10
你做了什么你的单声道构建?你使用MonoDevelop/Xamarin吗?您是否使用单声道命令提示符/ shell中的mcs/gmcs?还是你只是在Visual Studio中构建? – 2014-10-12 16:35:38