Using protobuf-net in android
I'm using protobuf-net from the nuget package. When I have add the package to my xamaring android project I get and error on build telling me I have multiple versions of the following assemblies: System.Reflection.Emit.ILGengeration System.Reflection.Emit.Lightweight protobuf-net targets .netstandard and has added references to the above two assemblies. There are no other references in the project file (no duplicate) so I'm assuming that these assemblies are part of the standard xamarin in some way. If I remove the references then everything builds fine from Visual Studio. However our build system uses MSBuild and that fails to build with the following error: errorMSB4018: The "LinkAssemblies" task failed unexpectedly. Xamarin.Android.XamarinAndroidException: error XA2006: Reference to metadata item 'System.Reflection.MethodInfo System.Reflection.TypeExtensions::GetMethod(System.Type,System.String,System.Reflection.BindingFlags)' (defined in 'protobuf-net, Version=18.104.22.168, Culture=neutral, PublicKeyToken=257b51d87d2e4d67') from 'protobuf-net, Version=22.214.171.124, Culture=neutral, PublicKeyToken=257b51d87d2e4d67' could not be resolved. ---> Mono.Cecil.ResolutionException: Failed to resolve System.Reflection.MethodInfo System.Reflection.TypeExtensions::GetMethod(System.Type,System.String,System.Reflection.BindingFlags) at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference) at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction) at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body) at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method) at Mono.Linker.Steps.MarkStep.ProcessQueue() at Mono.Linker.Steps.MarkStep.Process() at Mono.Linker.Steps.MarkStep.Process(LinkContext context) at Mono.Linker.Pipeline.Process(LinkContext context) at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context) at Xamarin.Android.Tasks.LinkAssemblies.Execute() --- End of inner exception stack trace --- at Xamarin.Android.Diagnostic.Error(Int32 code, Exception innerException, String message, Object args) at Xamarin.Android.Tasks.LinkAssemblies.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() It appears that protobuf-net is trying to use a method from the assemblies I had to remove because of the duplicate error. How can I make the msbuild work when using protobuf-net from and Xamarin android project?
How to bring ImageView in front of Button in android 5?
How to set time by location Android
Shell script to extract image of an Android mobile
androidTestCompile and dependency on another module ends with ClassNotFoundException
Not able to create Sqlite database in Cordova
Animate listview rows, what is the proper place to do this?
Removing renamed/deleted folders from git tracking
Customize notification received with parse
How to repeat process of random position and image with this code
Problems of security code of android app when interacting with Java RESTful services
Push notification not receiving android
How can I design Material for older versions?
Google Glass unable to detect device compatibility with latest version
Google Analytics Android Real Time
Helper Activity to display Fragment?
I want to change .android folder [duplicate]