疯狂的asp.net错误

时间:2010-05-14 18:32:37

标签: asp.net-mvc

您好我在网站上调试问题时遇到问题。一切都在本地工作,本地和服务器数据库是相同的 关于错误的奇怪之处在于它指向错误堆栈中的本地开发机器。是疯了还是什么,文件发布并托管在服务器上,错误指向我本地开发盒上的一行代码。我觉得我正在失去情节。有人请帮忙清楚这里的空气,因为这很奇怪

Error in '/' Application.
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
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.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

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:

[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
   System.Collections.ArrayList.get_Item(Int32 index) +10066148
   System.Collections.Specialized.NameObjectCollectionBase.BaseGet(Int32 index) +17
   System.Web.HttpFileCollection.get_Item(Int32 index) +9
   System.Web.HttpFileCollectionWrapper.get_Item(Int32 index) +18
   PitchPortal.Web.Binders.DocumentModelBinder.ValidateAndAssignPostedFile(ControllerContext controllerContext, ModelBindingContext bindingContext, Document doc) in C:\Users\Bich Vu\Documents\Visual Studio 2008\Projects\PitchPortal\PitchPortal.Web\Binders\DocumentModelBinder.cs:73
   PitchPortal.Web.Binders.DocumentModelBinder.BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) in C:\Users\Bich Vu\Documents\Visual Studio 2008\Projects\PitchPortal\PitchPortal.Web\Binders\DocumentModelBinder.cs:45
   System.Web.Mvc.ControllerActionInvoker.GetParameterValue(ControllerContext controllerContext, ParameterDescriptor parameterDescriptor) +404
   System.Web.Mvc.ControllerActionInvoker.GetParameterValues(ControllerContext controllerContext, ActionDescriptor actionDescriptor) +140
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +658084
   System.Web.Mvc.Controller.ExecuteCore() +125
   System.Web.Mvc.c__DisplayClass8.b__4() +48
   System.Web.Mvc.Async.c__DisplayClass1.b__0() +21
   System.Web.Mvc.Async.c__DisplayClass8`1.b__7(IAsyncResult _) +15
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +85
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +51
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +454
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +263

3 个答案:

答案 0 :(得分:5)

  

关于错误的奇怪之处在于   它指向我当地的开发者   机器在错误堆栈中。就是它   疯狂或什么

不,不是:-) pdb(程序数据库文件)包含有关文件的信息。 http://msdn.microsoft.com/en-us/library/ms241903.aspx

由于您在部署到服务器之前在本地编译它,因此PDB存储有关本地文件的信息。这并不意味着您的服务器正在与您的开发盒通信。

答案 1 :(得分:0)

关闭开发框,然后重新运行该应用。在没有意识到的情况下,某些东西正在击中你的开发盒。

答案 2 :(得分:0)

堆栈跟踪根据您编译它的开发机器引用文件路径。要删除生产服务器的这些工件,您应该在发布模式下进行编译,该模式不包含完整的调试信息。