FileNotFoundException for mscorlib.XmlSerializers.DLL, which doesn't exist

后端 未结 3 1001
难免孤独
难免孤独 2020-12-31 09:00

I\'m using an XmlSerializer to deserialize a particular type in mscorelib.dll

XmlSerializer ser = new XmlSerializer( typeof( [.Net type in System] ) );
retur         


        
3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-31 09:34

    I'm guessing now. but:

    1. The system might be generating a serializer for the whole of mscorlib, which could be very slow.
    2. You could probably avoid this by wrapping the system type in your own type and serialising that instead - then you'd get a serializer for your own assembly.
    3. You might be able to build the serializer for mscorlib with sgen.exe, which was the old way of building serializer dlls before it got integrated into VS.

提交回复
热议问题