Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

125
Views
Protobuf-net v2 alpha compile dll problem for iphone

We're developing a cross-platform online game using unity3d(monotouch) engine (C#), and we use protobuf-net (thanks to Marc Gravell) as protocol. As we know, reflection does not work on iOS. It is not allowed by Apple to have code generated dynamically. We checked Marc's blog (http://marcgravell.blogspot.com/), and found the early protobuf-net v2(though it's not completed yet) may avoid reflection problem.

we made some test and try to pre-compile serialize code into dll file, howerver, when we run it on ios , we got the following message.

>

     System.IO.FileNotFoundException has been thrown
>     “Could not load file or assembly “DataBuilder , Version=0.0.0.0 , 
> Culture = neutrual , PublicKeyToken =
> null ”” or one of its dependencies.”

here is our compile dll code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ProtoBuf;
using ProtoBuf.Meta;
using Data;
using System.Reflection;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var bb = TypeModel.Create();
            bb.Add(typeof(Customer), true);
            bb.Compile("DataBuilder", "databuilder.dll");
        }
    }
}   

here is our test code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Data;
using System.IO;
using ProtoBuf;
using ProtoBuf.Meta;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var creater = new DataBuilder();  // that's it

            var dd = new Data.Customer();
            dd.Name = "Hellow World";
            dd.CustomerId = "1232";
            MemoryStream mm = new MemoryStream();
            creater.Serialize(mm, dd);
            mm.Seek(0, SeekOrigin.Begin);
            Data.Customer c = (Data.Customer)creater.Deserialize(mm, null, typeof(Data.Customer));
            Console.WriteLine(c.Name);
        }
    }
}

We compiled dll under Windows enviornment(compact framework .net 3.5), maybe it didn't work on monotouch.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!