I got through fixing all the null handling errors I was seeing on my dev site. Everything works great. So I bundle up the module and install it on production. Arrgh, I get:
InnerException: Invalid cast from 'System.Int16' to 'System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'.
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Convert.DefaultToType
StackTrace:
Message: DotNetNuke.Services.Exceptions.ModuleLoadException: Invalid cast from 'System.Int16' to 'System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'. ---> System.InvalidCastException: Invalid cast from 'System.Int16' to 'System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'. at System.Convert.DefaultToType(IConvertible value, Type targetType, IFormatProvider provider) at System.Int16.System.IConvertible.ToType(Type type, IFormatProvider provider) at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) at DotNetNuke.Common.Utilities.CBO.HydrateObject(Object hydratedObject, IDataReader dr) at DotNetNuke.Common.Utilities.CBO.FillObjectFromReader(Object objObject, IDataReader dr) at DotNetNuke.Common.Utilities.CBO.CreateObjectFromReader(Type objType, IDataReader dr, Boolean closeReader) at DotNetNuke.Common.Utilities.CBO.FillListFromReader(Type objType, IDataReader dr, IList objList, Boolean closeReader) at DotNetNuke.Common.Utilities.CBO.FillCollection(IDataReader dr, Type objType) at Crewstone.Modules.RaceBaseCS.Components.RaceRegistrationController.GetItem(Int32 RaceId, Int32 PortalId) at Crewstone.Modules.RaceBaseCS.RaceRegistrationView.Page_Load(Object sender, EventArgs e) --- End of inner exception stack trace -
No way to reproduce this on the dev site, so I'm at a loss how to fix it and that part of the prod site in now down.