This project is read-only.

Object reference not set to an instance of an object.

Dec 7, 2011 at 4:43 PM

Hm - just tried the latest version. And still do have big trouble.

When I use the gallery as a content-type all seems nice. But when I do a F5 or refresh then I always get

Object reference not set to an instance of an object.


[NullReferenceException: Object reference not set to an instance of an object.]
   Orchard.Core.Containers.Controllers.ItemController.Display(String path, PagerParameters pagerParameters) in d:\Builds\OrchardFull\src\Orchard.Web\Core\Containers\Controllers\ItemController.cs:62
   lambda_method(Closure , ControllerBase , Object[] ) +135
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +208
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
   System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +55
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
   System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
   System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
   System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +191
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343
   System.Web.Mvc.Controller.ExecuteCore() +116
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   Orchard.Mvc.Routes.HttpAsyncHandler.EndProcessRequest(IAsyncResult result) in d:\Builds\OrchardFull\src\Orchard\Mvc\Routes\ShellRoute.cs:148
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8964029
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
Dec 7, 2011 at 4:55 PM

Hello Christian,

Can you please give me some details about your environment? Are you running on Azure? Do you have any other module installed?

Also, please specify the steps to reproduce this error.

Thank you for your feedback,

Gabriel

Dec 7, 2011 at 5:12 PM

Standard installation, local machine. No other modules.

Dec 8, 2011 at 11:51 AM

I was unable to reproduce this. That is to say while viewing an image gallery I was able to press F5 to refresh the page. I was using an image gallery configured with the LightBox plugin on image gallery 1.3 and Orchard v.1.3.0.0.

Any other info that might be helpful?

Dec 8, 2011 at 12:38 PM

Hm, nope, sorry. No more data, unfortuantely.

I was able to use another gallery which seems to work.

Dec 8, 2011 at 9:50 PM

Hi Christian,

Thanks for replying, would like to get to the bottom of this if we can. Unfortunate you have not given us much information to work with.
The exception is occurring inside Orchard not the the image gallery module not to say that this module is not causing the exception. I do suspect that the problem is to do with your configuration, but we are still happy to help get to the bottom of it.
Can you confirm what version of Orchard you are using it says on the bottom of your local site?

If you are a Developer and have Visual studio installed. Try attaching to the orchard project. Put a brake point where the exception is thrown and investigate the difference between when it crashes and when it does not. You can use the call stack to work your way back up, this should help to determine where the null is coming from.

If doing the above is not an option would it be possible for you to zip your entire OrchardFull folder, stick it online - say in dropbox - and then send us a link?
You would need to remove any personal information that you dont want others to see, including images, default password, text and so forth. To be clear all your content is in the app data folder.

Would that be something we could try, if not we will have to park this. With no information to go on I would not be able pinpoint the root cause of the problem.

This issue sounds similar and might be of interest http://orchard.codeplex.com/workitem/17583.
This is the source of the file that is causing the problem.

Dec 9, 2011 at 11:27 AM

Lemme try it again... will report back.

Dec 9, 2011 at 11:36 AM

I just re-installed the gallery. When I now click on 'Image Gallery' (without doing anything else before) in the dashboard I get this:

Server Error in '/' Application.

Parameter is not valid.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentException: Parameter is not valid.

Source Error: 

Line 30:                     </td>
Line 31:                     <td>
Line 32:                         @imageGallery.Images.Count()
Line 33:                     </td>
Line 34:                     <td>


Source File: c:\Users\Christian\Documents\My Web Sites\orchard2\Modules\Mello.ImageGallery\Views\Admin\Index.cshtml    Line: 32 

Stack Trace: 

[ArgumentException: Parameter is not valid.]
   System.Drawing.Image.FromStream(Stream stream, Boolean useEmbeddedColorManagement, Boolean validateImageData) +1147639
   Mello.ImageGallery.Services.ThumbnailService.CreateThumbnail(String image, String thumbnailFolderPath, String imageName, Int32 thumbnailWidth, Int32 thumbnailHeight, Boolean keepAspectRatio) +138
   Mello.ImageGallery.Services.ThumbnailService.GetThumbnail(String image, Int32 thumbnailWidth, Int32 thumbnailHeight, Boolean keepAspectRatio) +74
   Mello.ImageGallery.Services.ImageGalleryService.CreateImageFromMediaFile(MediaFile mediaFile, ImageGallerySettingsRecord imageGallerySettings) +156
   Mello.ImageGallery.Services.<>c__DisplayClass1c.<CreateImageGalleryFromMediaFolder>b__19(MediaFile image) +14
   System.Linq.WhereSelectListIterator`2.MoveNext() +110
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +325
   System.Linq.<GetEnumerator>d__0.MoveNext() +96
   System.Linq.Enumerable.Count(IEnumerable`1 source) +201
   ASP._Page_Modules_Mello_ImageGallery_Views_admin_Index_cshtml.Execute() in c:\Users\Christian\Documents\My Web Sites\orchard2\Modules\Mello.ImageGallery\Views\Admin\Index.cshtml:32
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +209
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +81
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +90
   System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +220
   System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +115
   Orchard.Mvc.ViewEngines.ThemeAwareness.<>c__DisplayClass7.<FindView>b__5(ViewContext viewContext, TextWriter writer, IViewDataContainer viewDataContainer) in d:\Builds\OrchardFull\src\Orchard\Mvc\ViewEngines\ThemeAwareness\LayoutAwareViewEngine.cs:59
   Orchard.Mvc.ViewEngines.ThemeAwareness.LayoutView.Render(ViewContext viewContext, TextWriter writer) in d:\Builds\OrchardFull\src\Orchard\Mvc\ViewEngines\ThemeAwareness\LayoutAwareViewEngine.cs:90
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +303
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +23
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +177
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343
   System.Web.Mvc.Controller.ExecuteCore() +116
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   Orchard.Mvc.Routes.HttpAsyncHandler.EndProcessRequest(IAsyncResult result) in d:\Builds\OrchardFull\src\Orchard\Mvc\Routes\ShellRoute.cs:148
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8964029
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184



Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.468

Dec 9, 2011 at 11:38 AM

Try deleting everything from Media\Default\ImageGalleries

Dec 9, 2011 at 12:22 PM

I do have Media\ImageGalleries

 

But this is also used by other pages/galleries

Sep 5, 2013 at 6:15 AM
The problem is due to the uploading of image gallery folders via FTP. At least for me. What you want to do is delete the uploaded folders and then add them through the admin panel instead.