Pregunta

I successfully used sgen.exe to create my MyLibrary.XmlSerializer.dll assembly, because I want to avoid the waste of time for the "first" deserialization.

But now, how to use it?

I mean, where do I have to put MyLibrary.XmlSerializer.dll to be used? How to be sure?

Thanks!

¿Fue útil?

Solución

Just put it in the same folder as your MyLibrary.dll and it will automatically be used if it matches your MyLibrary.dll (e.g. it won't be used if it's out of date, every new build of your library needs a new sgen run).

You can check that it was loaded with external tools like Process Explorer. In Process Explorer, open the properties window of your process and check the ".NET Assemblies" tab. Your MyLibrary.XmlSerializer.dll will be listed there if it was loaded.

But be careful: It will also show as loaded if it's out of date (of course, otherwise it can't check if it's out of date). If a temporary assembly is created for XML serialization, that one will also be shown there. Usually it has a random name (like "uki54k3f") and doesn't show a path. So if you have such a random name in your assembly list after creating an instance of XmlSerializer it is an indication that your Sgen assembly isn't used.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top