1
Vote

RuntimeBinder Exception

description

Using latest source code (1.4)
  1. Create a new Image (MediaGarden | Image). I uploaded a single jpg and accepted default settings for everything: Choose file, Go, Import all.
  2. Select Content from the dashboard menu.
  3. Click View next to newly created Image
    ==> RuntimeBinder Exception
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException was unhandled by user code
Message='MediaGarden.Models.MediaPart' does not contain a definition for 'MediaSource'
Source=Anonymously Hosted DynamicMethods Assembly
StackTrace:
   at lambda_method(Closure )
   at ClaySharp.ClayBehavior.GetMemberMissing(Func`1 proceed, Object self, String name) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehavior.cs:line 17
   at Orchard.ContentManagement.ContentItemBehavior.GetMemberMissing(Func`1 proceed, Object self, String name) in C:\Users\Dave\Projects\Orchard\Orchard\src\Orchard\ContentManagement\ContentItemBehavior.cs:line 18
   at Orchard.ContentManagement.ContentPartBehavior.GetMemberMissing(Func`1 proceed, Object self, String name) in C:\Users\Dave\Projects\Orchard\Orchard\src\Orchard\ContentManagement\ContentPartBehavior.cs:line 17
   at ClaySharp.ClayBehaviorCollection.<>c__DisplayClass38.<>c__DisplayClass3a.<GetMemberMissing>b__37() in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 53
   at ClaySharp.ClayBehaviorCollection.Execute(Func`1 proceed, Func`3 linker) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 13
   at ClaySharp.ClayBehaviorCollection.GetMemberMissing(Func`1 proceed, Object self, String name) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 53
   at lambda_method(Closure )
   at ClaySharp.ClayBehavior.GetMember(Func`1 proceed, Object self, String name) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehavior.cs:line 8
   at ClaySharp.ClayBehaviorCollection.<>c__DisplayClass2.<>c__DisplayClass4.<GetMember>b__1() in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 17
   at ClaySharp.ClayBehaviorCollection.Execute(Func`1 proceed, Func`3 linker) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 13
   at ClaySharp.ClayBehaviorCollection.GetMember(Func`1 proceed, Object self, String name) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 17
   at MediaGarden.ImageResizer.Filters.ImageResizingDisplayFilter.Displaying(Object context) in c:\Users\Dave\Projects\Orchard\Orchard\src\Orchard.Web\Modules\MediaGarden.ImageResizer\Filters\ImageResizingDisplayFilter.cs:line 32
InnerException:

comments

bsdr wrote Feb 15, 2012 at 10:24 PM

Please ignore for now. I just tried this again using a clean installation and could not reproduce it. Sorry.

bsdr wrote Feb 15, 2012 at 10:29 PM

It does crash on a clean install. I had forgotten to click 'View'. So this is a bug.

bsdr wrote Feb 15, 2012 at 11:29 PM

If I click on Edit instead of View (in the Content list on the Dashboard) then I get the following exception:

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

randompete wrote Feb 16, 2012 at 11:00 AM

Thanks for reporting - should be fixed in latest changeset. API has changed to remove reliance on IMediaSource (meaning media items can exist independently of media source records). Since here it was being accessed dynamically it wasn't picked up in compilation. Test suites will be implemented eventually to catch this type of problem!