序列化()不使用.XmlSerializers.dll生产与SGEN [英] Serialize() not using .XmlSerializers.dll produced with Sgen

查看:215
本文介绍了序列化()不使用.XmlSerializers.dll生产与SGEN的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在.NET 3.5库SGEN一步,产生正确的XYZ.XmlSerializers.dll在输出目录。 仍然有序列化性能差,我发现,.NET依然调用CSC在运行时。使用进程监视器,我看到.NET正在寻找一个名为DLLXYZ.XmlSerializers.-1378521009.dll。

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".

为什么会出现-1378521009的文件名?如何判断.NET使用由SGEN产生的'正常'的DLL?

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

推荐答案

绕,未免有反射戳,这似乎当您使用XmlSerializer的(类型,String)构造的情况发生,指定自定义命名空间。尝试使用XmlSerializer(类型)的构造来代替。

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.

这篇关于序列化()不使用.XmlSerializers.dll生产与SGEN的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆