Thursday, September 08, 2005

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.

9/8/2005 2:22:14 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]  |  Trackback

Related Posts:
Access Denied While Signing Assembly
Enabling Web Services for Testing outside of the Localhost
Another Error from Visual Studio 2005 SP1
XNA Game Studio Express Released
Looking For Source Code
The /3GB switch and .NET applications


Referred by:
http://www.bloglines.com/myblogs_display?sub=16371240&site=2... [Referral]
Microsoft.AnalysisServices.AdomdClient.AdomdConnectionException (www.google.com.co) [Referral]
guid object iconvertible (blogsearch.google.com) [Referral]
adomd AdomdConnectionException (www.google.pl) [Referral]
Microsoft.AnalysisServices.AdomdClient.AdomdConnectionException (www.google.com) [Referral]
Exception type: AdomdConnectionException (www.google.no) [Referral]
AdomdConnectionException (www.google.co.jp) [Referral]
ADOmdConnectionException (www.google.es) [Referral]
serialization, "invalid cast" (www.google.co.uk) [Referral]
AdomdConnectionException (www.google.ca) [Referral]
AdomdConnectionException (www.google.pt) [Referral]
AdomdConnectionException (www.google.com.mx) [Referral]
AdomdConnectionException (www.google.nl) [Referral]
Microsoft.AnalysisServices.AdomdClient.AdomdConnectionException: A connection (www.google.com) [Referral]
Exception type: Microsoft.AnalysisServices.AdomdClient.AdomdConnectionException (www.google.co.nz) [Referral]
Microsoft.AnalysisServices.AdomdClient.AdomdConnectionException: A (www.google.ca) [Referral]
Microsoft.AnalysisServices.AdomdClient.ConnectionExceptionCause (www.google.it) [Referral]
Microsoft.AnalysisServices.AdomdClient.AdomdConnectionException: A connection ca (www.google.com) [Referral]