Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

AbpWebModule AddIgnoredTypes doesn't seems to work in 12.0.2 #1694


User avatar
0
korigoth created

Hey,

I've updated my project to V0.12.0.2, because i've seen that you added the Ignore type to the AbpWebModule

I'm in MVC Project, so i checked the dependency,

ProjectWebModule -> AbpWebMvcModule -> AbpWebModule dependency.

AbpWebModule is calling AddIgnoredTypes to the Validation Ignore type but i still get the validation errors on the V0.12.0.2 while trying to post file to my MVC controller!

I use 'HttpPostedFileWrapper' object that it is in the Ignore List added by AddIgnoredTypes.

If I doesn't post a file, it work perfectly, but if I post a file, I get this error :

Method arguments are not valid! See ValidationErrors for details.

   at Abp.Runtime.Validation.Interception.MethodInvocationValidator.Validate() in D:\Halil\GitHub\aspnetboilerplate\src\Abp\Runtime\Validation\Interception\MethodInvocationValidator.cs:line 89
   at Abp.Web.Mvc.Validation.AbpMvcValidationFilter.OnActionExecuting(ActionExecutingContext filterContext) in D:\Halil\GitHub\aspnetboilerplate\src\Abp.Web.Mvc\Web\Mvc\Validation\AbpMvcValidationFilter.cs:line 35
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.InvokeActionMethodFilterAsynchronouslyRecursive(Int32 filterIndex)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.InvokeActionMethodFilterAsynchronouslyRecursive(Int32 filterIndex)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.InvokeActionMethodFilterAsynchronouslyRecursive(Int32 filterIndex)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__31(AsyncCallback asyncCallback, Object asyncState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallBeginDelegate(AsyncCallback callback, Object callbackState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters, AsyncCallback callback, Object state)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__19(AsyncCallback asyncCallback, Object asyncState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallBeginDelegate(AsyncCallback callback, Object callbackState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeAction(ControllerContext controllerContext, String actionName, AsyncCallback callback, Object state)
   at System.Web.Mvc.Controller.<BeginExecuteCore>b__1c(AsyncCallback asyncCallback, Object asyncState, ExecuteCoreState innerState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout)
   at System.Web.Mvc.Controller.BeginExecuteCore(AsyncCallback callback, Object state)
   at System.Web.Mvc.Controller.<BeginExecute>b__14(AsyncCallback asyncCallback, Object callbackState, Controller controller)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout)
   at System.Web.Mvc.Controller.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state)
   at System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state)
   at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__4(AsyncCallback asyncCallback, Object asyncState, ProcessRequestState innerState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout)
   at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
   at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state)
   at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

6 Answer(s)
  • User Avatar
    0
    korigoth created

    Bump,

    Did you test it ?

    Because it seems to be a problem for other than me too...

    <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1384">https://github.com/aspnetboilerplate/as ... ssues/1384</a>

    the ignored type doesn't work in the MVC controller Validation

    And we doesn't want to disable validation because the Framework is supposed to handle it properly

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    We have tried this but couldn't reproduce the problem. Do you have a test project which we can reproduce the error with ?

    If you can share it, we will look into it and fix the problem.

  • User Avatar
    0
    korigoth created

    Hey,

    Here is a project where i tested to upload a file and still, it doesn't work!

    <a class="postlink" href="https://www.dropbox.com/s/zeyk4b6mq1wzdjv/TestUpload.rar?dl=0">https://www.dropbox.com/s/zeyk4b6mq1wzd ... d.rar?dl=0</a>

    Here is what i've done to test!

    -> Download Project Templace with MVC -> Update Nuget-Package -> Create ViewModel with HttpPostedFileWrapper Object -> Create Action to Receive ViewModel -> Create Form with File Input -> Test!

    In the project, go to the "About" Page and try to send a file.

    If you doesn't send a file, it doesn't trigger an error, but if u send a file it's triggering ValidationError.

    Here is the error :

    WARN  2016-09-23 15:22:10,690 [5    ] stUpload.Web.Controllers.AboutController - Method arguments are not valid! See ValidationErrors for details.
    Abp.Runtime.Validation.AbpValidationException: Method arguments are not valid! See ValidationErrors for details.
       at Abp.Runtime.Validation.Interception.MethodInvocationValidator.Validate() in D:\Halil\GitHub\aspnetboilerplate\src\Abp\Runtime\Validation\Interception\MethodInvocationValidator.cs:line 89
       at Abp.Web.Mvc.Validation.AbpMvcValidationFilter.OnActionExecuting(ActionExecutingContext filterContext) in D:\Halil\GitHub\aspnetboilerplate\src\Abp.Web.Mvc\Web\Mvc\Validation\AbpMvcValidationFilter.cs:line 35
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.InvokeActionMethodFilterAsynchronouslyRecursive(Int32 filterIndex)
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.InvokeActionMethodFilterAsynchronouslyRecursive(Int32 filterIndex)
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.InvokeActionMethodFilterAsynchronouslyRecursive(Int32 filterIndex)
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__31(AsyncCallback asyncCallback, Object asyncState)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallBeginDelegate(AsyncCallback callback, Object callbackState)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout)
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters, AsyncCallback callback, Object state)
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__19(AsyncCallback asyncCallback, Object asyncState)
    

    thx to take time to fix this or point me out what's wrong! :)

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    It seems like you are not setting your form's enctype to multipart/form-data. It causes PostFile to be null and MVC sets the ModelState.IsValid to false in that case.

    If you change your form definition to

    <form action="/About" method="post" enctype="multipart/form-data">
    .....
    </form>
    

    your problem will be solved I think.

  • User Avatar
    0
    allenwalsh created

    hi, Even I am also facing same problem. I have tried all solution which are given above to resolve my problem. If you will find the right solution of your problem, then please revert me also. thanks:

  • User Avatar
    0
    korigoth created

    Damn,

    i didn't know about this part!

    Thanks a lot it work perfectly!