2010-05-14 231 views
1

嗨我有一个问题,在网站上调试问题。一切工作在本地,本地和服务器数据库是相同的 关于错误的奇怪之处在于它指向我的本地开发机器在错误堆栈中。是疯了还是什么,这些文件发布并托管在服务器机器上,错误指向我本地开发框上的一行代码。我觉得我正在失去这个阴谋。有人可以帮助清空这里,因为这是非常奇怪的疯狂asp.net错误

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
+1

如果你在本地机器上编译它,那就是堆栈跟踪将显示源文件中位置的内容。该源代码甚至可能不在您的服务器上,您可以部署这些DLL。 – 2010-05-14 18:38:51

+0

如果没有源代码,堆栈跟踪并不是很有启发性,你可以发布你的代码。 当您将调试代码部署到其他机器上时,您经常会像堆栈跟踪中那样获取文件引用,我认为将编译该dll的机器上的源代码路径存储在符号文件中。 – 2010-05-14 18:39:59

回答

0

关闭您的开发盒,然后重新运行应用程序。没有你意识到的东西会击中你的开发盒。

+0

确定会尝试,这只是疯狂 – dominic 2010-05-14 18:43:16

0

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

4

关于错误的奇怪之处是 它指向我的本地dev 机器在错误堆栈中。是 疯了还是什么

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

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