Bug 58846 - dynamic does not work anymore
Summary: dynamic does not work anymore
Status: RESOLVED DUPLICATE of bug 58625
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 7.4 (15.3)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
Depends on:
Reported: 2017-08-17 12:20 UTC by Silviu Lupu
Modified: 2017-09-18 22:12 UTC (History)
7 users (show)

Is this bug a regression?: Yes
Last known good build: 7.3(15.2)

Visual Studio info (27.28 KB, image/png)
2017-08-17 12:20 UTC, Silviu Lupu

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:

Description Silviu Lupu 2017-08-17 12:20:07 UTC
Created attachment 24270 [details]
Visual Studio info


After I update to the latest Xamarin version, I found out that dynamic does not work anymore. In 7.3, it did.
I am making a Single-View app, in Visual Studio 2017, using Newtonsoft.Json Nuget library. I am testing on an Android 5.0 tablet.
Build configuration (Debug, Any CPU): 
- Minimum = 5.0 (API 21)
- Target = Use Compile using SDK version.
- Target Framework = 7.1

My code:
dynamic average = new JObject() as dynamic;
average.Test = 1; // This is where the crash happens.

The error stack:

System.PlatformNotSupportedException: Operation is not supported on this platform.
  at System.Runtime.InteropServices.Marshal.IsComObject (System.Object o) [0x00000] in <183b200ee49746d48fc781625979428e>:0 
  at Microsoft.CSharp.RuntimeBinder.BinderHelper.IsComObject (System.Object obj) [0x00003] in <0c600cab29754882aa1761854aaa8abf>:0 
  at Microsoft.CSharp.RuntimeBinder.BinderHelper.IsDynamicallyTypedRuntimeProxy (System.Dynamic.DynamicMetaObject argument, Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo info) [0x00011] in <0c600cab29754882aa1761854aaa8abf>:0 
  at Microsoft.CSharp.RuntimeBinder.BinderHelper.DeduceArgumentRestriction (System.Int32 parameterIndex, Microsoft.CSharp.RuntimeBinder.ICSharpInvokeOrInvokeMemberBinder callPayload, System.Dynamic.DynamicMetaObject argument, Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo info) [0x00011] in <0c600cab29754882aa1761854aaa8abf>:0 
  at Microsoft.CSharp.RuntimeBinder.BinderHelper.Bind (System.Dynamic.DynamicMetaObjectBinder action, Microsoft.CSharp.RuntimeBinder.RuntimeBinder binder, System.Dynamic.DynamicMetaObject[] args, System.Collections.Generic.IEnumerable`1[T] arginfos, System.Dynamic.DynamicMetaObject onBindingError) [0x000a3] in <0c600cab29754882aa1761854aaa8abf>:0 
  at Microsoft.CSharp.RuntimeBinder.CSharpSetMemberBinder.FallbackSetMember (System.Dynamic.DynamicMetaObject target, System.Dynamic.DynamicMetaObject value, System.Dynamic.DynamicMetaObject errorSuggestion) [0x00000] in <0c600cab29754882aa1761854aaa8abf>:0 
  at System.Dynamic.SetMemberBinder.FallbackSetMember (System.Dynamic.DynamicMetaObject target, System.Dynamic.DynamicMetaObject value) [0x00000] in <b5bd9d990a0b4733885e90ca5ec6c0fb>:0 
  at System.Dynamic.DynamicMetaObject.BindSetMember (System.Dynamic.SetMemberBinder binder, System.Dynamic.DynamicMetaObject value) [0x0000b] in <b5bd9d990a0b4733885e90ca5ec6c0fb>:0 
  at System.Dynamic.DynamicObject+MetaDynamic.BindSetMember (System.Dynamic.SetMemberBinder binder, System.Dynamic.DynamicMetaObject value) [0x0003e] in <b5bd9d990a0b4733885e90ca5ec6c0fb>:0 
  at System.Dynamic.SetMemberBinder.Bind (System.Dynamic.DynamicMetaObject target, System.Dynamic.DynamicMetaObject[] args) [0x00035] in <b5bd9d990a0b4733885e90ca5ec6c0fb>:0 
  at System.Dynamic.DynamicMetaObjectBinder.Bind (System.Object[] args, System.Collections.ObjectModel.ReadOnlyCollection`1[T] parameters, System.Linq.Expressions.LabelTarget returnLabel) [0x000c6] in <b5bd9d990a0b4733885e90ca5ec6c0fb>:0 
  at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T] (System.Runtime.CompilerServices.CallSite`1[T] site, System.Object[] args) [0x00019] in <b5bd9d990a0b4733885e90ca5ec6c0fb>:0 
  at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet] (System.Runtime.CompilerServices.CallSite site, T0 arg0, T1 arg1) [0x000fc] in <b5bd9d990a0b4733885e90ca5ec6c0fb>:0 


I then tried to use this info (https://developer.xamarin.com/api/type/System.Dynamic.DynamicObject/) but the result was the same.

dynamic Average = new MyDynamic();
Average.Test = 1; // Crashes here with the same error.
class MyDynamic : DynamicObject{}


I have attached my Visual Studio information.
Comment 1 davide 2017-08-17 12:59:24 UTC
Same issue for me...

Sorry but Xamarin releases are so bad lately. Each release has some kind of bug...
Comment 2 Jon Douglas [MSFT] 2017-08-17 16:14:42 UTC

*** This bug has been marked as a duplicate of bug 58625 ***
Comment 3 Paradise 2017-08-18 21:34:23 UTC
same for me ...
Comment 4 SimonW 2017-08-21 09:38:44 UTC
Same for me too. App is unusable.