Created attachment 2697 [details]
The project in question.
I was trying to create a simple WCF service for testing on my Windows 7 machine in MonoDevelop. Once I got it up and running I decided to copy the same project onto my Ubuntu machine and run it. When I ran my WCF server, and got the following exception, "Cannot cast from source type to destination type.". After looking online for a solution I realized it was a generic error so I started digging around for different solutions.
This service uses an app.config file for configuring its service endpoints that I had copied from another project of mine and modified for this one. I was able to finally figure out that it was related to the behaviorConfiguration of the service in the config, only by deduction.
<behavior name="serviceBehavior" >
<dataContractSerializer maxItemsInObjectGraph="2147483647" /> <!--The problem lies here in this line-->
<serviceDebug includeExceptionDetailInFaults="true" />
In my previous project I had to allocate for the maximum amount of items to be sent over the wire. Removing that line allowed my simple app to run, but just wanted to point it out for a bug report if it is one.
Oddly enough it worked on my Windows machine but not Ubuntu 12.04.