I took a memory dump of IIS and while analyzing i found the error that said 'Could not load file or assembly MyAssemblyName.XmlSerializers'. In my code i am using XmlSerializer class to serialize and deserialize xml contents from xml file to custom object. When the project gets build it only creates MyAssembly.dll and MyAssembly.pdb file but not the MyAssembly.XmlSerializers.dll. Does anyone know how to enable my project to create xmlserializers.dll file?
Note: In project build tab, 'Generate serialization assembly is set to Auto.
Thanks.
In . NET, XmlSerializers. dll is for serializing/deserializing the . NET classes. Its more for performance boost.
The serialization assembly improves the startup performance of a XmlSerializer when it serializes or deserializes objects of the specified types.
There's an answer already here. Apparently this is "expected behaviour" that MS isn't going to fix.
The first comment has a workaround:
One of the possible ways to get rid of this problem is check "Just my code" option in Tools -> Options -> Debugging -> General options
You can also generate this assembly using Sgen.exe
For me it's located in: C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools
1. open cmd command 2. cd yourProjectPath 3. sgen Project.dll
The following command creates an assembly named Project.XmlSerializers.dll for serializing all the types contained in the assembly named Project.dll.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With