Search code examples
.net.net-2.0ixmlserializable

Will implementing IXMLSerializable create a serializer DLL file in my Temp directory?


Normally, when using the XMLSerializer to automagically serialize an ISerializable object, a .dll file is generated on C:\WINDOWS\Temp.

If I implement IXMLSerializable instead, where I'm telling it how to serialize / deserialize, will it also generate this DLL?
I have a very simple class to serialize, and I'm trying to avoid this automatic generation of files, for permissions reasons.

Any ideas?

Thanks.


Solution

  • Using IXmlSerializable won't keep it from creating an assembly. In order to do that, in the project properties, look:

    1. On the Build tab for C#, there's a "Generate Serialization Assembly" dropdown.
    2. On the Compile tab for VB.NET, there's an "Advanced Compile Options" button. Click it, and you'll find a "Generate Serialization Assemblies" dropdown.

    In both cases, you can set it to "Off" and manually use the XML Serializer Generator Tool (Sgen.exe) to generate your assemblies.