【发布时间】:2018-08-26 16:48:53
【问题描述】:
我正在尝试使用此代码序列化“PrinterSettings”:
Private Sub pAddEditPrinterSettings(ByVal uPrinterSettings As PrinterSettings)
Dim s As String = String.Empty
Dim nXSer As New Xml.Serialization.XmlSerializer(uPrinterSettings.GetType())
Using sw As New StringWriter
nXSer.Serialize(sw, uPrinterSettings)
s = sw.ToString()
End Using
但是,“nXSer As New ...”行失败并出现错误
BindingFailure: The assembly with the name "System.Drawing.XmlSerializers" wasn't found in the LoadFrom binding contexts of AppDomain with ID 1. Cause: System.IO.FileNotFoundException: The file or assembly "SystemDrawing.XmlSerializers, Version=4.0.0.0,Culture=neutral,PublicKeyToken b03f5f7f11d50a3a or a dependency wasn't found. The system couldn't find the file.
我在这里可能做错了什么?
谢谢。
【问题讨论】:
标签: xml vb.net serialization dll