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