Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

116
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda