473,385 Members | 1,893 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,385 software developers and data experts.

Avoiding dynamic generation (+compilation) of XML-Serialization cl

We are building a suite of programs consisting of both winforms applications
and
office addins.

We would like to pre-generate the xml-serialization classes and add it to
our project to
avoid the overhead at startup and thus enhance the performance of our
applications.

The programs are coded in c# under .net 1.1.

The programs use web-services to communication with a server.

We are experincing a rather slow startup of both the winforms applications,
but also the officeproducts (Excel, Word, etc.).

We have isolated the startup overhead to the .net runtime code generation
and compilation of
Microsoft.Xml.Serialization.GeneratedAssembly.

We have tried to solve the problem by
1) Adding
<system.diagnostics>
<switches>
<add name="XmlSerialization.Compilation" value="4" />
</switches>
</system.diagnostics>
to the application config file.
(This will leave the generated and compiled serialization files in the
%TEMP% directory)
2) Starting the application (to get the files generated)
3) Getting the generated .cs file (from the %TEMP% directory)
4) Adding the .cs file with the
System.Xml.Serialization.XmlSerializationWriter class to the project
5) Rebuilding the application.

Unfortunately it seems like this have no effect.
Monitoring the modified application shows that it still generates the .cs
file (current size > 1MB), compiles
it and loads the resulting dll.

Are we missing something? Should we modify the generated code in any way
before including it in the project.
(We are aware that .net 2.0 and the sgen.exe tool might help, but currently
we are stuck with .net 1.1)

Thank you in advance

Mar 22 '06 #1
1 3467
Hi tqvist,

Welcome to the MSDN newsgroup.

As for the Xml serialization assemblies, based on my research there is not
built-in support on pregeneration of them(like what we can do in the .NET
2.0). So far what I can get are the following two options:

1. There exists an hotfix for .net 1.1's webservice client-side
application, we can use it to build a custom pregeneration tool to
pregenerate serialization assembies for webservcie client proxy. However,
this seems to be specific to webservice client proxy rather than all kinds
of xmlserization. You can have a look to see whether it helps:

#FIX: Web service clients regenerate serialization assemblies every time
that the application runs
http://support.microsoft.com/?id=872800

2.You can also try NGEN tool which can help make our .net
application/assembly prebuilt into native images, it can help improve
client application's startup performance.

#Native Image Generator (Ngen.exe)
http://msdn.microsoft.com/library/en...veimagegenerat
orngenexe.asp?frame=true
Hope this helps some.

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may

learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Mar 23 '06 #2

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

Similar topics

0
by: Rasmus Fogh | last post by:
Someone raised the question of automatic code generation a few weeks back. And yes, we (CCPN) are using automatic Python code generation in a major way. Basically we are making data models in...
1
by: maddog | last post by:
sorry, I don't know if is this the right group. I build a class-lib in csharp, and there comments are well xml formed.(///) I have another project use the class-lib(a dll file) I builed...
0
by: Bill | last post by:
By dynamic mapping, I meant that before the records are transferred from one table to the other(source to target), the xml file which will have the field names of the two tables mapped, is to be...
11
by: Wolfgang Kaml | last post by:
I am not sure if this is more of an expert question, but I am sure that they are out there. I'd like to setup a general application or bin directory on my Win2003.Net Server that will hold some...
0
by: Hugo Ferreira | last post by:
Hi all, I'm having a problem here, to which I hope someone to be able to help me :) I need to apply a XSLT transformation to the output of all my ASPX webpages. I've recently found the tag...
4
by: Mark R. Dawson | last post by:
Hi all, does anyone know of any tools which can be used with .Net 2.0 to create XML documentation. There used to be a tool in VS2003 which would do this, but it is not in 2005 and I also used to...
2
by: Ghada Al-Mashaqbeh via DotNetMonster.com | last post by:
Hi all, I am facing a problem in dynamic code generation at run time, the problem occurs when the dynmaic code use global data exist within the original application. Lets say that my...
5
by: pittendrigh | last post by:
There must be millions of dynamically generated html pages out there now, built by on-the-fly php code (and jsp, perl cgi, asp, etc). Programatic page generation is transparently useful. But...
3
by: Mukesh | last post by:
sir, i am developing a database, which will store the users profile both personal and professional which includes the address, telephone, gender and etc. in my main table i have created a column...
3
by: Adam Baker | last post by:
This is a fairly broad question. I have looked for web sites or books on the topic, by to no avail. I'm creating a fairly small web site in which the content is drawn from an XML file (more or...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.