Bug 1788 - ProtoBuf issues
Summary: ProtoBuf issues
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 5.0
Hardware: PC Mac OS
: High normal
Target Milestone: Untriaged
Assignee: Sebastien Pouliot
URL: https://github.com/t9mike/ProtoBuf1
Depends on:
Reported: 2011-10-30 23:36 UTC by t9mike
Modified: 2011-11-07 22:51 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description t9mike 2011-10-30 23:36:07 UTC
See sample from https://github.com/t9mike/ProtoBuf1

1) Cannot use link SDK only option with MonoTouch/TestProtoBuf1.csproj. Receive this error when I do:

Linking SDK only for assembly /Users/XXX/iOS-Dev/MonoTouch-Bugs-Requests/ProtoBuf1-Test/ProtoBuf1/MonoTouch/bin/iPhoneSimulator/Debug/TabPlusNav1.exe into /Users/XXX/iOS-Dev/MonoTouch-Bugs-Requests/ProtoBuf1-Test/ProtoBuf1/MonoTouch/bin/iPhoneSimulator/Debug/TestProtoBuf1.app
Could not link assemblies: Mono.Linker.ResolutionException: Can not resolve reference: System.Void System.ComponentModel.ImmutableObjectAttribute::.ctor(System.Boolean)
  at Mono.Linker.Steps.MarkStep.ResolveMethodDefinition (Mono.Cecil.MethodReference method) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.MarkMethod (Mono.Cecil.MethodReference reference) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.MarkCustomAttribute (Mono.Cecil.CustomAttribute ca) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.MarkCustomAttributes (ICustomAttributeProvider provider) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.MarkType (Mono.Cecil.TypeReference reference) [0x00000] in <filename unknown>:0 
  at MonoTouch.Tuner.MonoTouchMarkStep.MarkType (Mono.Cecil.TypeReference reference) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.InitializeType (Mono.Cecil.TypeDefinition type) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.InitializeAssembly (Mono.Cecil.AssemblyDefinition assembly) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.Initialize () [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0 
  at MonoTouch.Tuner.Linker.Run (Mono.Linker.Pipeline pipeline, Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0 

2) Sample protobuf-net code runs fine on simulator but crashes on device.
Comment 1 Sebastien Pouliot 2011-10-31 09:14:09 UTC
ref: http://stackoverflow.com/q/7940838/220643
Comment 2 Sebastien Pouliot 2011-10-31 09:47:00 UTC
System.ComponentModel.ImmutableObjectAttribute is not part of the profile shipped with any version MonoTouch. The most likely cause is that the assembly was compiled against another framework and that some type(s) are missing (there could be others too).

note: The AOT compiler does not like "broken" assemblies so this could be related.
Comment 3 Sebastien Pouliot 2011-11-07 22:51:34 UTC
working with a newer build of protobuf (which fixed #1) and MT 5.0.2 (that likely fixed #2 (bug #1824)
details in url form comment #1

thanks for providing a test case! I'll keep a link to it :-)