Serialize() not using .XmlSerializers.dll produced with Sgen

丶灬走出姿态 提交于 2019-12-08 04:09:29

问题


I have a sgen step in my .NET 3.5 library, producing a correct XYZ.XmlSerializers.dll in the output directory. Still having poor serialization performance, I discovered that .NET was still invoking a csc at runtime. Using process monitor, I saw that .NET was searching for a dll named "XYZ.XmlSerializers.-1378521009.dll".

Why is there a '-1378521009' in the filename ? How to tell .NET to use the 'normal' DLL produced by sgen ?


回答1:


Poking around a bit with Reflector, this seems to happen when you use the XmlSerializer(Type, string) constructor, specifying a custom namespace. Try using the XmlSerializer(Type) constructor instead.



来源:https://stackoverflow.com/questions/4851626/serialize-not-using-xmlserializers-dll-produced-with-sgen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!