473,404 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

XmlSerializer-generated temp files

Hello,

I would like to know if there is a way to cache the xmlserializer-generated
temp files and have the program reuse these cached files upon new
application instances. For example, application 1 launches. The first time
it uses the serializable classes the XmlSerializer will create a source file
on the fly and compile it and use this file to serilize and deserilize the
XML. When Application 1 is launched in a new instance say instance 2 it
will also have to recreate the on the fly source files and compile them. Is
there a way to have the application reuse a precompiled source file for use
in the xmlserilization? My XmlSerilization classes are becoming larger and
taking longer for the xmlserilizer to run on the first time through... Now
i know one of the reasons this is either not possible or reconmended is
because if the class in changed the precompiled code has to be updated and
this is an outside process from the compilation. I think I am a big enough
programmer to handle that task :)

Is there a way to tell the XmlSerilizer that it does not have to generate a
new source file of the serilizable classes but allow me to tell it here is
one already done to speed up that first time hit?

What I am thinking the plan could be is that before my product is released
to our customers I will at run time run the XmlSerilizer to produce the
final generated source code and compile that to an assembly. When this
assembly is built i will include this file in the final release of my
product. From there the product will use this pre generated file for
increased performance of first time us of the serialization classes.

Is this possible?!?
Nov 12 '05 #1
1 2936
Take a look at the sgen.exe tool....

XML Serializer Generator Tool (Sgen.exe)
The XML Serializer Generator creates an XML serialization assembly for types in a specified assembly in order to improve the startup performance of a ...

Search for it on msdn...

Or you can also create a static class that caches the XmlSerializer...
Jul 19 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Stuart Robertson | last post by:
I am trying to find a solution that will allow me to use XmlSerializer to serialize/deserialize a collection of objects where a given object is shared between two or more other objects, and not...
1
by: Bluetears76 | last post by:
Hi I have a hirachy of classes which are Message(base), then FileMessage and ChatMessage (extended) I want to serialize the objects and when i am deserizaling i dont know if i am getting...
3
by: Anthony Bouch | last post by:
Hi I've been reading using the XmlSerializer with custom collections. I've discovered that when serializing a custom collection (a class that implements ICollection, IList etc.) the...
3
by: grs | last post by:
I am using some Microsoft examples that: 1. Serialize an object using XmlSerializer and write a file out to the harddrive. 2. Read back in the file using XmlDocument.Load and populate a string. ...
1
by: Xing Zhou | last post by:
It seems that XmlSerializer.FromTypes() method cannot handle inner class properly .. or is there anything I did wrong? The following code will throw a reflection exception at FromTypes() method....
3
by: Loui Mercieca | last post by:
Hi, I have created a class, named FormField , which basically contains two fields, name and value. I have set the tag before the class and the field is set as an XmlAttribute whil the name as...
4
by: Steve Long | last post by:
Hello, I hope this is the right group to post this to. I'm trying to serialize a class I've written and I'd like to be able to serialze to both binary and xml formats. Binary serialization is...
4
by: SteveT | last post by:
I have a data structure that I am writing to an XML file using XmlSerializer. XmlSerializer xSer = new XmlSerializer(typeof(MyData)); StreamWriter sw = new StreamWriter("SomeData.xml");...
3
by: kimtherkelsen | last post by:
Hi, I want to send XML data from a server to some clients over a network connection using the TCP/IP protocol. If I send the XMLs as byte arrays I need to insert header information in the data to...
6
by: Andrew | last post by:
I am using an XmlSerializer to save some settings and I have discovered that when a string is saved containing a cr+nl it is replaced with just a newline when loading back in. I am no expert with...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.