在使用Backload上载文件的已发布ASP.NET MVC4应用程序上获取异常
本文关键字:MVC4 NET ASP 应用 应用程序 异常 获取 程序上 Backload 上载 文件 | 更新日期: 2023-09-27 18:30:06
在Visual Studio中工作并测试我的应用程序时,一切都很好。我正在使用Backload将文件上传到服务器。然而,当试图在发布到本地IIS服务器时上传文件时,我会遇到以下异常:
算术运算导致溢出。
完整的堆栈跟踪如下:
[OverflowException: Arithmetic operation resulted in an overflow.]
System.IntPtr.op_Explicit(IntPtr value) +37
筦屎긑쾖㨚�䓝�.敕蛘᷏ꂫ�۟똿뽎() +2030
.cctor() +115
[TypeInitializationException: The type initializer for '<Module>' threw an exception.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +159
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +256
System.Activator.CreateInstance(Type type, Boolean nonPublic) +127
System.Activator.CreateInstance(Type type) +11
System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +92
[InvalidOperationException: An error occurred when trying to create a controller of type 'Backload.Controllers.BackloadController'. Make sure that the controller has a parameterless public constructor.]
System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +256
System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +81
System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +270
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +86
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +12550671
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
IIS服务器拥有写入上载文件夹的所有权限。尝试访问localhost/mySite/backload/UploadHandler 上的backload时会发生此错误
使用的反向加载版本是1.9.2.2(是的,我得到了那些中国/日本的标志,不知道为什么)
编辑:刚刚尝试从github导入示例,结果出现了完全相同的错误!
这与问题#17有关,将在即将发布的1.9.3中修复。阅读此处:https://github.com/blackcity/Backload/issues/17
编辑:刚刚看到,Nuget上有一个1.9.3版本的候选版本。您应该检查此版本,如果异常仍然存在,请通知开发人员。他们通常会很快地尝试包含错误修复。http://www.nuget.org/packages/Backload/