System.XML Reference Issue

I currently can't compile my code ATM because I keep getting the following error:
Code:

return Serializer.DeserializeWithLengthPrefix(stream, ProtoBuf.PrefixStyle.Base128);

Error:

Error CS0012: The type 'System.Xml.Serialization.IXmlSerializable' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

I've already added System.Xml to my references. I even went into the folder where .NET stores System.Xml and manually added it. In that case, I can compile, but I cannot run the application on my phone.

I'm working on this code with another person. The other person is able to compile. He's on Mac OS X and I'm on Windows 7, so I'm not sure if that has anything to do with it. As you can see, we're also using ProtoBuf-net, so that might also have something to do with it. I've tried numerous versions of ProtoBuf-net and I keep getting the same error.

I've been stuck on this issue for almost two weeks now and it's really deterring my development. Any help would be greatly appreciated.

Posts

  • mhutchmhutch USXamarin Team Xamurai

    You can't (reliably) use assemblies that target a different framework. It sounds to me like you're referencing a library that was built against the .NET 2.0 framework from a Xamarin.iOS project. You should rebuild the code against Xamarin.iOS.

Sign In or Register to comment.