XmlSerializers Assembly

  • Thread starter Maciej Wolniewicz
  • Start date
M

Maciej Wolniewicz

Hello,

I'm quite new in developing for CF. In my application I'm using
XMLSerializer for deserializing few XML files. In full framework 2.0
it is possible to create XmlSerializers assembly, where are stored
XmlSerializers for each type from some dll file and everything works
correctly and fast.

Problem starts if I'll do the same for Pocket PC application. This
xmlserializers assembly is ignored during runtime.
I'm creating this assembly by calling "Sgen exe" in post-built
events.

I found on the Net, that if different constructor for XmlSerializer
than with type only will be used, then every time temporary assembly
for XmlSerializer will be created.

Does this xmlserializers assembly are not suported in CF2 or I'm doing
something wrong.

Thanks in advance for your help.

Maciej Wolniewicz
 
M

Maciej Wolniewicz

Hi,

thanks for your answer but I think you does not understand my question
or I construct it wrong. I try to write it more clearly.

First creation of XMLSerializer instance during runtime cause that
temporary assembly is created with code that is executed during
serialization or deserialization by XmlSerializer. In full framework
2.0 it is possible to create this assembly during compilation an
distribute it with application, which makes xml serialization more
efficient.

I know, that XmlSerializer is available on CF2, but I wonder if it is
possible to use this generated assembly in CF2? I can create assembly
with xmlserializer code manually, but during runtime it is not loaded
and performance is no as good as I need.

To improve performance I keep XmlSerializer instance in memory, but
I'm interested in improving startup of XmlSerializer.

I hope now it clear if not then I'm sorry.

Regards,

Maciej Wolniewicz
 
N

Neil Cowburn

The XmlSerializer in the .NET Compact Framework does not create a temporary
assembly like the .NET Framework XmlSerializer. There a number of reasons
for this design decision, a major one being that the .NET Compact Framework
does not support the System.Refection.Emit API.

--
Neil Cowburn
Principal Partner
OpenNETCF Consulting, LLC.

Managed Code in the Embedded World

http://www.opennetcf.com/
http://www.smartdeviceframework.com/
 
M

Maciej Wolniewicz

I thought that XmlSerializer works as in full .NET Framework.

Thanks Neil for telling me that I was wrong:). So I think the best way
to improve performance is to cache XmlSerializer.

Regards,

Maciej Wolniewicz.
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top