Hi,
Just to let the developers of NHibernate know:
When upgrading from NHibernate 1.0.4 to 1.20GA we got alot of InvalidProxyTypeExceptions.
This is because all mapped properties must have the 'virtual' keyword.
However, because we are working on such a large project, all the mapped properties where in chaotic order.
I download the source-code of NHibernate and added the following lines in NHibernate.InvalidProxyTypeException.
Can someone developer integrate this as enhancement in JIRA?
Code:
public class InvalidProxyTypeException : MappingException
....
private static string FormatMessage(ICollection errors)
{
StringBuilder result = new StringBuilder("The following types may not be used as proxies:");
+ ArrayList sortItFirst = new ArrayList();
+ sortItFirst.AddRange(errors);
+ sortItFirst.Sort();
+ errors = sortItFirst;
foreach (string error in errors)
{
result.Append('\n').Append(error);
For our upgrade, this was really helpfull so others might benefit from this as well.
Thanks,