'Csla.Server.DataPortalException' to type 'Csla.Server.DataPortalResult'

'Csla.Server.DataPortalException' to type 'Csla.Server.DataPortalResult'

Old forum URL: forums.lhotka.net/forums/t/11464.aspx


vignesh posted on Tuesday, July 10, 2012

Unable to cast object of type 'Csla.Server.DataPortalException' to type 'Csla.Server.DataPortalResult'

is this web service error or code error can one give me the clear scenario about  this ....  

Thanks.

 

 

 

 

StefanCop replied on Tuesday, July 10, 2012

Error and valid results are usually not the same. If you could give the code snippet, where the cast occurs or at least the call.

vignesh replied on Wednesday, July 11, 2012

Hi stefan,

here the call stack for the  error....it happens while it try to call the WCF web service. 

Server Error in '/' Application.

Unable to cast object of type 'Csla.Server.DataPortalException' to type 'Csla.Server.DataPortalResult'.

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.InvalidCastException: Unable to cast object of type 'Csla.Server.DataPortalException' to type 'Csla.Server.DataPortalResult'.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

[InvalidCastException: Unable to cast object of type 'Csla.Server.DataPortalException' to type 'Csla.Server.DataPortalResult'.]
   HIA.BM.BL.CSLAClasses.HIADataPortal.Fetch(Type objectType, Object criteria) +388
   HIA.BM.BL.CSLAClasses.HIADataPortal.Fetch(Object criteria) +50
   HIA.BM.BL.CollectionClasses.ModulePermissionsCollection.GetHIAModuleCollection() +640
   HIA.BM.Web.Controllers.AccountController.Login(String username, String password, Boolean rememberMe, String returnUrl) +711
   lambda_method(Closure , ControllerBase , Object[] ) +284
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +248
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39
   System.Web.Mvc.<>c__DisplayClassa.<InvokeActionMethodWithFilters>b__7() +126
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +641
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +641
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +312
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +741
   System.Web.Mvc.Controller.ExecuteCore() +198
   System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) +195
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +597
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +266


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

 

RockfordLhotka replied on Thursday, July 12, 2012

This is occuring in CSLA 4 version 4.3.x?

vigneshwaranv replied on Friday, July 13, 2012

It's occurring in CSLA 4 version...........

vigneshwaranv replied on Friday, July 13, 2012

it's occurring in CSLA 4.0.0.0  version...........

JonnyBee replied on Friday, July 13, 2012

This obviously happens in the class HIADataPortal - which is not a part of CSLA.

It seems lke you have implemented your own HIADataPortal and there is a bug in this class - NOT CSLA. .

Copyright (c) Marimer LLC