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 on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
I am using SlSvcUtil.exe to generate DomainService classes to access our existing WCF RIA Services server (using a soap endpoint).
However after upgrading to MonoTouch 220.127.116.11 I am now unable to get/set the CookieContainer property on the generated domain service classes.
The get function always returns null and the set function throws the following exception: "System.InvalidOperationException: Unable to set the CookieContainer.
Please make sure the binding contains an HttpCookieContainerBindingElement."
Getting and setting the CookieContainer worked perfectly in MonoTouch 4.0.3.
This issue is the exact same as the one posted here: http://stackoverflow.com/questions/5425011/unable-to-set-cookiecontainer-on-service-client-in-monotouch/6895995
Please attach a small test case (so I'm sure I testing the same code you're hitting) and I'll track down the regression. Thanks!
Created attachment 45 [details]
Simple test case
Comment on attachment 45 [details]
Simple test case
I have attached a simple test project that shows the problem. Code runs fine on MT 4.0.3 but not 18.104.22.168.
It works here. My code is more recent (than 22.214.171.124) but I don't recall any WCF related changes.
// On MT 4.0.3 the property will return a valid object. MT 126.96.36.199 returns null.
CookieContainer cookieContainer = authClient.CookieContainer;
That's not null for me.
// MT 188.8.131.52 throws an exception regardless of cookieContainer being a valid object or not. Works fine on MT 4.0.3
authClient.CookieContainer = cookieContainer;
That works without any exception (but your exception was likely related to the null value).
Can you confirm the attached sample fails for you ? (last minute error ?)
I'll ask around if someone has 184.108.40.206 installed to compare results.
I just retested the attached sample on 4.0.3 and 220.127.116.11 on both the simulator and on my device. On 4.0.3 cookieContainer is a valid object, but on 18.104.22.168 it is null and the exception is thrown.
Setting the property will throw the exception on 22.214.171.124 regardless of the cookieContainer being null or valid. The reason is the httpCookieContainerManager being null inside the authClient.CookieContainer property.
I am using MonoDevelop 2.4.2 on MacOS 10.6.8.
Rodrigo, using MT master just like me, does not get the exception. Sadly I'm not exactly sure why that happens on 126.96.36.199 (a lot of build changes occurred since then).
Please try again once MT 4.1 is released and, worse case scenario, re-open the bug report if it still occurs.