I knew i forgot something. Sorry about that.
Using: SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll version 2.6.08.0624
For completeness, here's all the code:
public static class SortExpressionExtensions
{
public static string WriteXml(this SortExpression sortExpression)
{
string xml = string.Empty;
using (TextWriter w = new StringWriter())
{
XmlSerializer s = new XmlSerializer(typeof(SortExpression));
s.Serialize(w, sortExpression);
w.Flush();
xml = w.ToString();
w.Close();
}
return xml.Trim();
}
}
When i'm using it like:
protected void MainLLBLGenProDataSource2_PerformSelect(object sender, SD.LLBLGen.Pro.ORMSupportClasses.PerformSelectEventArgs2 e)
{
SortExpression se = new SortExpression();
foreach (ISortClause sc in e.Sorter)
se.Add(new SortClause(sc.FieldToSortCore, sc.PersistenceInfo, sc.SortOperatorToUse, sc.ObjectAlias));
string sXml = se.WriteXml();
}
The error is at line:
XmlSerializer s = new XmlSerializer(typeof(SortExpression));