This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 58625 - Dynamic Type Platform not supported exception
Summary: Dynamic Type Platform not supported exception
Alias: None
Product: Runtime
Classification: Mono
Component: General (show other bugs)
Version: 5.4
Hardware: Macintosh Mac OS
: High critical
Target Milestone: 15.4
Assignee: Marek Habersack
: 58846 (view as bug list)
Depends on:
Reported: 2017-08-07 18:04 UTC by robertalmalak7
Modified: 2017-09-05 09:52 UTC (History)
18 users (show)

See Also:
Is this bug a regression?: ---
Last known good build:

reproduction (177.94 KB, application/x-rar)
2017-08-16 14:06 UTC, Omar

Description robertalmalak7 2017-08-07 18:04:40 UTC
Having now the same issue on Android as I had on iOS:
Comment 1 Marek Habersack 2017-08-08 13:20:02 UTC
The fix for the issue is in xamarin-android/master and xamarin-android/d15-4
Comment 2 spoiltnr1 2017-08-15 10:30:26 UTC
Just got hit by this when updating to VS 15.3! This is a major blocker! When will this fix be rolled out?
Comment 3 kyle.spearrin 2017-08-15 16:29:26 UTC
Just updated to VS 15.3 and am now hitting this bug too :(
Comment 4 ulrich 2017-08-15 17:53:47 UTC
I have the same problem, this is blocking my project.
Is there already a new VS installer package that fixes the problem?
Comment 5 Omar 2017-08-16 09:39:47 UTC
same problem overhere
Comment 6 Omar 2017-08-16 14:06:08 UTC
Created attachment 24239 [details]
Comment 7 Omar 2017-08-16 14:08:27 UTC
The attached project is built and run on the latest releases, it will crash (check the output window) when you navigate to the ItemDetailsPage

[0:] System.PlatformNotSupportedException: Operation is not supported on this platform.
  at System.Runtime.InteropServices.Marshal.IsComObject (System.Object o) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/ 
  at Microsoft.CSharp.RuntimeBinder.BinderHelper.IsComObject (System.Object obj) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/ 
  at Microsoft.CSharp.RuntimeBinder.BinderHelper.IsDynamicallyTypedRuntimeProxy (System.Dynamic.DynamicMetaObject argument, Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo info) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/ 
  at Microsoft.CSharp.RuntimeBinder.BinderHelper.DeduceArgumentRestriction (System.Int32 parameterIndex, Microsoft.CSharp.RuntimeBinder.ICSharpInvokeOrInvokeMemberBinder callPayload, System.Dynamic.DynamicMetaObject argument, Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo info) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/ 
  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 /Library/Frameworks/Xamarin.iOS.framework/Versions/ 
  at Microsoft.CSharp.RuntimeBinder.CSharpGetMemberBinder.FallbackGetMember (System.Dynamic.DynamicMetaObject target, System.Dynamic.DynamicMetaObject errorSuggestion) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/ 
  at System.Dynamic.GetMemberBinder.FallbackGetMember (System.Dynamic.DynamicMetaObject target) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/ 
  at System.Dynamic.DynamicMetaObject.BindGetMember (System.Dynamic.GetMemberBinder binder) [0x0000b] in /Library/Frameworks/Xamarin.iOS.framework/Versions/ 
  at System.Dynamic.GetMemberBinder.Bind (System.Dynamic.DynamicMetaObject target, System.Dynamic.DynamicMetaObject[] args) [0x00020] in /Library/Frameworks/Xamarin.iOS.framework/Versions/ 
  at System.Dynamic.DynamicMetaObjectBinder.Bind (System.Object[] args, System.Collections.ObjectModel.ReadOnlyCollection`1[T] parameters, System.Linq.Expressions.LabelTarget returnLabel) [0x000c6] in /Library/Frameworks/Xamarin.iOS.framework/Versions/ 
  at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T] (System.Runtime.CompilerServices.CallSite`1[T] site, System.Object[] args) [0x00019] in /Library/Frameworks/Xamarin.iOS.framework/Versions/ 
  at System.Runtime.CompilerServices.CallSiteOps.Bind[T] (System.Runtime.CompilerServices.CallSiteBinder binder, System.Runtime.CompilerServices.CallSite`1[T] site, System.Object[] args) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/ 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /Library/Frameworks/Xamarin.iOS.framework/Versions/ 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/ 
  at System.Linq.Expressions.Interpreter.ExceptionHelpers.UnwrapAndRethrow (System.Reflection.TargetInvocationException exception) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/ 
  at System.Linq.Expressions.Interpreter.MethodInfoCallInstruction.Run (System.Linq.Expressions.Interpreter.InterpretedFrame frame) [0x00035] in /Library/Frameworks/Xamarin.iOS.framework/Versions/ 
  at System.Linq.Expressions.Interpreter.Interpreter.Run (System.Linq.Expressions.Interpreter.InterpretedFrame frame) [0x00015] in /Library/Frameworks/Xamarin.iOS.framework/Versions/ 
  at System.Linq.Expressions.Interpreter.LightLambda.Run2[T0,T1,TRet] (T0 arg0, T1 arg1) [0x0002a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/ 
  at App3.ViewModels.ItemDetailViewModel+<ExecuteLoadItemCommand>d__16.MoveNext () [0x000c6] in c:\users\omar hattab\documents\visual studio 2017\Projects\App3\App3\App3\ViewModels\ItemDetailViewModel.cs:41
Comment 8 Marek Habersack 2017-08-16 18:07:22 UTC
The fix is part of Xamarin.Android and newer and should be rolled out as part of the next (15.4) update.
Comment 9 Omar 2017-08-16 18:20:51 UTC
The problem is that this is a major blocker, and can't wait till 15.4. We have just updated our machines to 15.3 and all of a sudden this crash hit us, it's not only on Android, but on iOS as well. Our work is now literally stopped because we depend heavily on dynamic types as we're dealing with objects returned from some APIs.
Comment 10 kyle.spearrin 2017-08-16 18:23:19 UTC
We're in the same boat. Seems like this needs an emergency hotfix.
Comment 11 ulrich 2017-08-16 19:44:27 UTC
I have changed my project to use only object instead of dynamic an then call GetMethod() and Invoke().
Comment 12 James Croft 2017-08-17 14:03:33 UTC
Again, in the same boat as others here. If this is fixed, it should definitely be rolled out sooner rather than later. Can't expect something that's meant to be production ready to be broken and wait for the next update.
Comment 13 Jon Douglas [MSFT] 2017-08-17 16:14:42 UTC
*** Bug 58846 has been marked as a duplicate of this bug. ***
Comment 14 Jacky Waswani 2017-08-18 13:01:12 UTC
Verified this bug on d15-4 latest Xamarin.Android Version:

Environment info : 
Visual Studio Enterprise 2017 for Mac (Preview)
Version 7.2 Preview (7.2 build 540)
Xamarin.iOS Version: 
Xamarin.Android Version:
Xamarin.Mac Version:
Operating System Mac OS X 10.12.5

Complete info :
Attached Logs.

Steps : 
1. Download attachment and open the solution 
2. Build and run project in both Debug and release mode respectively 

Application builds and deployed successfully.
Able to debug it without any crash.
Kindly let us know if anything else is required as QA validation else we can mark this bug as verified for 15.4.
Comment 16 Paradise 2017-08-18 21:37:36 UTC
same for me ...
Comment 17 A.Maury 2017-08-21 13:36:09 UTC
Any hotfix found while waiting for 15.4 ?
Same issue even with latest preview version.
Comment 21 SimonW 2017-08-21 14:43:54 UTC
We have hit this issue today too. 
I have installed the Preview of VS2017 and tried updating Xamarin.Android to the latest preview version but installs, not which contains the fix.
Comment 22 A.Maury 2017-08-21 15:07:28 UTC
You can download 15.0 after registering for Dev Essentials.
After setting up everything again for me it worked.
It seems that updating Xamarin is never easy.
Comment 23 SimonW 2017-08-21 15:23:07 UTC
Thanks for the link, I take it you've not updated that to 15.3 again though?
Comment 24 Silviu Lupu 2017-08-21 15:24:43 UTC

I did that (update from 15.0 downloaded, to 15.3 directly), but ended up back to not working. The idea is that 15.0 allows to work with dynamics, but you loose other things on the other hand (like tuples).
Comment 25 A.Maury 2017-08-21 17:00:22 UTC
No, I'll stay with 15.0 until.. a new fix.

15.0 can handle C# 7 only Tuple requires a nuget package.
Comment 26 Brendan Zagaeski (Xamarin Support) 2017-08-22 22:31:31 UTC
## Status update for any users watching this issue

The candidate fix for this issue has now been published to the Stable and Beta updater channels as part of Xamarin.Android and Xamarin.iOS in the Xamarin 15.3.2 Servicing Release [1] and the Visual Studio 2017 version 15.3.2 release [2].

Comment 27 SimonW 2017-08-23 08:16:28 UTC
Updated VS2017 to 15.3.2 and I can confirm this issue is resolved in our Android app

Note You need to log in before you can comment on or make changes to this bug.