Bug 31550 - RuntimeBinderContext missing from Microsoft.CSharp in 4.0
Summary: RuntimeBinderContext missing from Microsoft.CSharp in 4.0
Status: RESOLVED ANSWERED
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: 4.0.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2015-07-01 16:14 UTC by Josh Becker
Modified: 2016-10-12 12:49 UTC (History)
4 users (show)

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

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 GitHub or Developer Community 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:
Status:
RESOLVED ANSWERED

Description Josh Becker 2015-07-01 16:14:50 UTC
When starting my application in 3.1.2 everything works as expected. But as soon as I start my application using mono 4.x I receive the following exception:

Could not load type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderContext' from assembly 'Microsoft.CSharp, Version=4.0.0.0, Culture=neutral`

This is due to RuntimeBinderContext not actually existing in mono 4.0, which feels like a regression.

I also posted on Stackoverflow here: https://stackoverflow.com/questions/30417128/mono-4-3-1-2-worked-fine-could-not-load-type-microsoft-csharp-runtimebinder-r
Comment 1 Arsen.Shnurkov 2016-09-28 04:54:00 UTC
I have this bug too (Linux, amd64)

Exception stack trace:
  at Microsoft.CSharp.RuntimeBinder.CSharpGetMemberBinder.FallbackGetMember (System.Dynamic.DynamicMetaObject target, System.Dynamic.DynamicMetaObject errorSuggestion) [0x00059] in /var/tmp/portage/dev-lang/mono-4.6.0.150/work/mono-4.6.0-abi_x86_64.amd64/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/CSharpGetMemberBinder.cs:60 
  at System.Dynamic.DynamicObject+MetaDynamic+<BindGetMember>c__AnonStorey0.<>m__0 (System.Dynamic.DynamicMetaObject e) [0x00000] in /var/tmp/portage/dev-lang/mono-4.6.0.150/work/mono-4.6.0-abi_x86_64.amd64/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicObject.cs:239 
  at System.Dynamic.DynamicObject+MetaDynamic.CallMethodWithResult (System.String methodName, System.Dynamic.DynamicMetaObjectBinder binder, System.Linq.Expressions.Expression[] args, System.Dynamic.DynamicObject+MetaDynamic+Fallback fallback, System.Dynamic.DynamicObject+MetaDynamic+Fallback fallbackInvoke) [0x00000] in /var/tmp/portage/dev-lang/mono-4.6.0.150/work/mono-4.6.0-abi_x86_64.amd64/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicObject.cs:447 
  at System.Dynamic.DynamicObject+MetaDynamic.CallMethodWithResult (System.String methodName, System.Dynamic.DynamicMetaObjectBinder binder, System.Linq.Expressions.Expression[] args, System.Dynamic.DynamicObject+MetaDynamic+Fallback fallback) [0x00000] in /var/tmp/portage/dev-lang/mono-4.6.0.150/work/mono-4.6.0-abi_x86_64.amd64/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicObject.cs:435 
  at System.Dynamic.DynamicObject+MetaDynamic.BindGetMember (System.Dynamic.GetMemberBinder binder) [0x00024] in /var/tmp/portage/dev-lang/mono-4.6.0.150/work/mono-4.6.0-abi_x86_64.amd64/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicObject.cs:239 
  at System.Dynamic.GetMemberBinder.Bind (System.Dynamic.DynamicMetaObject target, System.Dynamic.DynamicMetaObject[] args) [0x00024] in /var/tmp/portage/dev-lang/mono-4.6.0.150/work/mono-4.6.0-abi_x86_64.amd64/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/GetMemberBinder.cs:90 
  at System.Dynamic.DynamicMetaObjectBinder.Bind (System.Object[] args, System.Collections.ObjectModel.ReadOnlyCollection`1[T] parameters, System.Linq.Expressions.LabelTarget returnLabel) [0x000de] in /var/tmp/portage/dev-lang/mono-4.6.0.150/work/mono-4.6.0-abi_x86_64.amd64/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/DynamicMetaObjectBinder.cs:105 
  at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T] (System.Runtime.CompilerServices.CallSite`1[T] site, System.Object[] args) [0x0001c] in /var/tmp/portage/dev-lang/mono-4.6.0.150/work/mono-4.6.0-abi_x86_64.amd64/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/CallSiteBinder.cs:127 
  at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet] (System.Runtime.CompilerServices.CallSite site, T0 arg0) [0x0010d] in /var/tmp/portage/dev-lang/mono-4.6.0.150/work/mono-4.6.0-abi_x86_64.amd64/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/UpdateDelegates.Generated.cs:255 
  at Orchard.DisplayManagement.Implementation.DefaultShapeFactory.Create (System.String shapeType, Orchard.DisplayManagement.INamedEnumerable`1[T] parameters, System.Func`1[TResult] createShape) [0x00320] in /var/calculate/remote/distfiles/egit-src/Orchard.git/src/Orchard/DisplayManagement/Implementation/DefaultShapeFactory.cs:82 
  at Orchard.DisplayManagement.Implementation.DefaultShapeFactory.Create (System.String shapeType, Orchard.DisplayManagement.INamedEnumerable`1[T] parameters) [0x00021] in /var/calculate/remote/distfiles/egit-src/Orchard.git/src/Orchard/DisplayManagement/Implementation/DefaultShapeFactory.cs:31 
  at Orchard.UI.Zones.LayoutWorkContext.Get[T] (System.String name) [0x00029] in /var/calculate/remote/distfiles/egit-src/Orchard.git/src/Orchard/UI/Zones/LayoutWorkContext.cs:14 
  at Orchard.Environment.WorkContextImplementation+<FindResolverForState>c__AnonStorey0`1[T].<>m__0 (Orchard.IWorkContextStateProvider wcsp) [0x00007] in /var/calculate/remote/distfiles/egit-src/Orchard.git/src/Orchard/Environment/WorkContextImplementation.cs:32 
  at System.Linq.Enumerable+WhereSelectArrayIterator`2[TSource,TResult].MoveNext () [0x0004d] in /var/tmp/portage/dev-lang/mono-4.6.0.150/work/mono-4.6.0-abi_x86_64.amd64/mcs/class/referencesource/System.Core/System/Linq/Enumerable.cs:327 
  at System.Linq.Enumerable.FirstOrDefault[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x00041] in /var/tmp/portage/dev-lang/mono-4.6.0.150/work/mono-4.6.0-abi_x86_64.amd64/mcs/class/referencesource/System.Core/System/Linq/Enumerable.cs:986 
  at Orchard.Environment.WorkContextImplementation.FindResolverForState[T] (System.String name) [0x00039] in /var/calculate/remote/distfiles/egit-src/Orchard.git/src/Orchard/Environment/WorkContextImplementation.cs:32 
  at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (TKey key, System.Func`2[T,TResult] valueFactory) [0x00037] in /var/tmp/portage/dev-lang/mono-4.6.0.150/work/mono-4.6.0-abi_x86_64.amd64/mcs/class/referencesource/mscorlib/system/collections/Concurrent/ConcurrentDictionary.cs:1049 
  at Orchard.Environment.WorkContextImplementation.GetState[T] (System.String name) [0x00014] in /var/calculate/remote/distfiles/egit-src/Orchard.git/src/Orchard/Environment/WorkContextImplementation.cs:27 
  at Orchard.WorkContext.get_Layout () [0x00007] in /var/calculate/remote/distfiles/egit-src/Orchard.git/src/Orchard/WorkContext.cs:44 
  at Orchard.UI.Resources.ResourceFilter.OnResultExecuting (System.Web.Mvc.ResultExecutingContext filterContext) [0x00022] in /var/calculate/remote/distfiles/egit-src/Orchard.git/src/Orchard/UI/Resources/ResourceFilter.cs:23 
  at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter (System.Web.Mvc.IResultFilter filter, System.Web.Mvc.ResultExecutingContext preContext, System.Func`1[TResult] continuation) [0x00000] in <e4c4ae87a2804756bc5d464ec68e0752>:0 
  at System.Web.Mvc.ControllerActionInvoker+<>c__DisplayClass1a+<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19 () [0x00000] in <e4c4ae87a2804756bc5d464ec68e0752>:0 
  at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter (System.Web.Mvc.IResultFilter filter, System.Web.Mvc.ResultExecutingContext preContext, System.Func`1[TResult] continuation) [0x00022] in <e4c4ae87a2804756bc5d464ec68e0752>:0
Comment 3 Arsen.Shnurkov 2016-09-30 11:48:33 UTC
"RuntimeBinderContext not actually existing in mono 4.0"

actually it exists, but is not public (it is "internal static"). So, it is possible to call GetType for it with not null result (I checked on test example)
Comment 4 Marek Safar 2016-10-12 12:48:55 UTC
You are most likely missing Mono.CSharp.dll dependency.

You could use MONO_LOG_LEVEL=debug to check