源文件中的第0行在哪里 [英] Where is line 0 in a source file

查看:97
本文介绍了源文件中的第0行在哪里的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个有趣的。我们服务器上的一个Web应用程序突然开始抛出错误

Well this is a fun one. One of the web apps on our server has suddenly started throwing an error

IndexOutOfRangeException: Index was outside the bounds of the array.]
   WebServiceDeskPortalAdmin.MainPage.Page_Load(Object sender, EventArgs e) in C:\projects\WebServiceDeskPortalAdmin\WebServiceDeskPortalAdmin\MainPage.aspx.cs:0



在本地运行代码不显示此类错误并按设计运行。



我的想法在IIS设置中有些不妥,但仅仅是开发人员,我的IIs技能非常缺乏,我们的网络/网络管理员培训教育包含了stackoverflow潜伏。



唯一可能出现问题的是我们使用CA Siteminder进行用户身份验证。但是再一次没有人在这里接受任何真正的培训。



这台服务器上的另一个应用程序正常运行。



另一个奇怪的事情是它指向的文件是我的本地机器上的文件,其中构建并发布应用程序,然后复制到服务器。



我尝试了什么:



我试过启动和停止服务器。我还将web配置与运行相同应用程序的另一个框上的web配置进行了比较,发现没有差异


Running the code locally displays no such error and runs as designed.

My thought is something amiss in the IIS setup but being a mere developer my IIs skills are sorely lacking and Our web/network admin training education consists of stackoverflow lurking.

the only other thing that might be at issues is that we are using CA Siteminder for user auth. but again there is no one here with any real training in that package.

The other app on this server works just the way it is supposed to.

The other odd thing is the file it is pointing to is the one on my local machine where the app is built and published before being copied to the server.

What I have tried:

I have tried starting and stopping the server. I have also compared the web config to the web config on another box running the same app and found no differences

推荐答案

因为它是作为编译文件发布到服务器的,并应用优化等来删除行号?



因为您可能无法调试实时代码,所以需要向应用程序添加日志记录以尝试精确缩小哪个arry以及涉及哪个索引。鉴于它可能也与你的数据有关,我们真的不能为你做到这一点!
Because it's published to the server as a compiled file, and that applies optimizations and so forth which removes line numbers?

Because you probably can't debug "live code", you need to add logging to you app to try and narrow down exactly which arry and which index is involved. Given that it's probably also related to your data, we really can't do that for you!


作为一个懒惰的人,我从来没有看过我的日志文件,因为据说这个错误发生了在第0行,我们都知道源代码中没有第0行。然而,我走了,看起来只能告诉OldGriff他的建议是假的。事实证明崩溃是应用程序中的几行并且由于我打破了我自己的规则并重新使用变量然后尝试操作该变量,并假设它仍然具有第一个赋值的值(做字符串拆分)我是一个坏男孩
Well being a lazy guy I never looked at my log files because the error was said to happen on line 0 and we all know there is no line 0 in source code. However I went and looked just be able to tell OldGriff his advice was bogus. Turns out the crash was several lines into the app and caused by me breaking on of my own rules and reusing a variable and then attempting to manipulate that variable with the assumption it still had the value from the first assignment (doing string split) I am a bad boy


这篇关于源文件中的第0行在哪里的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆