Microsoft
Software
Hardware
Network
Question : Custom serialization with XMLSerializer in .NET
I have a class that I am serialising in .NET using the XMLSerializer class. I have 3 classes defined:
_
Public Class ManagerExposures
")> _
Public Version As String
_
Public Managers As List(Of ManagerRiskExposure)
Public Sub New()
Managers = New List(Of ManagerRiskExposure)
End Sub
End Class
", IsNullable:=False)> _
Public Class ManagerRiskExposure
_
Public Name As String
ration_tim
estamp")> _
Public ReportDate As String
_
Public Code As String
ity")> _
Public Liquidity As List(Of PositionExposure)
End Class
n_Exposure
", IsNullable:=False)> _
Public Class PositionExposure
ategoryid"
)> _
Public InvestmentCategoryId As Long
_
Public Name As String
_
Public ShortExposure As Double
_
Public LongExposure As Double
_
Public NetExposure As Double
_
Public GrossExposure As Double
")> _
Public RiskAbsolute As Double
_
Public TotalGrossExposure As Double
End Class
In the PositionExposure class, I have specified that i want the elements to appear with 'Position_Exposure'. However, when I view the serialised file, they always appear as PositionExposure.
Any ideas on why this is happening, and how I can correct it?
Thanks
Answer : Custom serialization with XMLSerializer in .NET
change XmlRoot("Position_Exposure
")> _
to
XmlType("Position_Exposure
")> _
Random Solutions
showing connected users to a file share
run macro on all worksheets in workbook
Visual Foxpro 7.0 training
Asp.Net aspx page can page be reloaded and retain Values
Error exporting to PDF when report language is set to French
How do you tell visual studio to reindent all code so you can match up the "if/else" "while", and strucs like that
Application.LoadFromText automation
Linking to Word document from Access Table or Query
When contacting <a rel="nofollow" href="https://mail.domain.com/autodiscover/autodiscover.xml" target="_blank">https://mail.domain.com/au<wbr />todiscover<wbr />/autodisco<wbr />ver.xml</a> receiv
Strange problem with tableAdapterManager.Update<wbr />All and related tables