Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 7701 on
GitHub or Developer Community if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
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.