In a project I'm
working on using ADOMD.NET there is some code that is throwing an
exception when we try to serialize a adomd connection exception object.
The error is show as:
Invalid
cast from
Microsoft.AnalysisServices.AdomdClient.ConnectionExceptionCause to
Microsoft.AnalysisServices.AdomdClient.AdomdErrorCollection.
[InvalidCastException:
Invalid cast from
Microsoft.AnalysisServices.AdomdClient.ConnectionExceptionCause to
Microsoft.AnalysisServices.AdomdClient.AdomdErrorCollection.]
System.Convert.DefaultToType(IConvertible value, Type targetType,
IFormatProvider provider) +1228
System.Enum.System.IConvertible.ToType(Type type, IFormatProvider
provider) +9 System.Convert.ChangeType(Object value, Type
conversionType, IFormatProvider provider) +1097
System.Runtime.Serialization.FormatterConverter.Convert(Object value,
Type type) +25
System.Runtime.Serialization.SerializationInfo.GetValue(String name,
Type type) +148
Microsoft.AnalysisServices.AdomdClient.AdomdConnectionException..ctor(SerializationInfo
info, StreamingContext context) +60
Using Reflector, there would appear to be a cast that is invalid in the constructor:
private AdomdConnectionException(SerializationInfo info, StreamingContext context) : base(info, context)
{
this.exceptionCause = ConnectionExceptionCause.Unspecified;
this.exceptionCause = (ConnectionExceptionCause) info.GetValue("ExceptionCauseProperty", typeof(AdomdErrorCollection));
}
Has anyone else seen this? Or have a workaround?
I've posted an article on an MSDN forum just in case someone from M$ spots it!
If you find this post via google hopefully someone has answer my questions.