DerrickBrayanClayton / protobuf-net

Automatically exported from code.google.com/p/protobuf-net
0 stars 0 forks source link

.NET CF Problems #113

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I have a .NET CF 3.5 project in which I would like to use protobuf-net.  I'm 
getting the following complie problems that I'm hoping someone can help with.  
I tried referencing System.Xml and System.Xml.XmlSerialization but I was still 
getting the errors.  These errors are occurring on both v1 and v2 (from trunk). 
 These errors DO NOT occur after I remove protobuf-net.  Any help is greatly 
appreciated.

Warning 1   Reference to type 'System.Runtime.Serialization.IFormatter' claims it 
is defined in 'c:\Program 
Files\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\mscorlib.dll', but it 
could not be found

Warning 2   Reference to type 'System.Runtime.Serialization.SerializationInfo' 
claims it is defined in 'c:\Program 
Files\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\mscorlib.dll', but it 
could not be found

Error   3   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'.

Error   4   The type 'System.Xml.XmlWriter' 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'.

My Code (v2):

            string path = Path.GetTempFileName();
            Serializer.PrepareSerializer<Message>();
            using (Stream file = File.Create(path))
            {
                Serializer.Serialize(file, sortedMessages);
                file.Close();
            }   

Original issue reported on code.google.com by umair.chagani on 9 Jun 2010 at 5:32

GoogleCodeExporter commented 8 years ago
Hi. There is a specific build for compact framework. For "v1", this is the CF20 
or CF35 zips (depending on the CF version). The "v2" build process is 
incomplete, but "build_cf20.bat" is probably a good starting point.

I can't guarantee that the "v2" trunk builds cleanly for all platforms at the 
moment - that is work in progress. But if you get problems, let me know.

Original comment by marc.gravell on 9 Jun 2010 at 6:52

GoogleCodeExporter commented 8 years ago
I'm getting a lot of errors when I run that batch file.  Please see attached 
file.  Thanks again for your help!

Original comment by umair.chagani on 10 Jun 2010 at 8:58

Attachments:

GoogleCodeExporter commented 8 years ago
OK; I've recently switch workstations, and it looks like VS2010 hates the 
earlier CF versions; I'm setting up a VM to investigate this and get the build 
cleaned.

Original comment by marc.gravell on 11 Jun 2010 at 1:02