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

115
Views
Protobuf-net v2 alpha compilar problema dll para iphone

Estamos desarrollando un juego en línea multiplataforma usando el motor unity3d(monotouch) (C#), y usamos protobuf-net (gracias a Marc Gravell) como protocolo. Como sabemos, la reflexión no funciona en iOS. Apple no permite que el código se genere dinámicamente. Revisamos el blog de Marc (http://marcgravell.blogspot.com/), y encontramos que la protobuf-net v2 anterior (aunque aún no está completa) puede evitar el problema de reflexión.

hicimos algunas pruebas e intentamos compilar previamente el código de serialización en un archivo dll, sin embargo, cuando lo ejecutamos en ios, recibimos el siguiente mensaje.

>

 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.”

aquí está nuestro código dll de compilación

 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"); } } }

aquí está nuestro código de prueba

 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); } } }

Compilamos dll en el entorno de Windows (compact framework .net 3.5), tal vez no funcionó en 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!