本地路径处于活动状态并导致 Web 应用程序出错。发布后
我们正在尝试在这里发布我们的小型网络应用程序。 我过去已经做过好几次了,效果非常好。 正如标签所述,它是一个使用 VS2008 编码的 MVC ASP.Net 项目。
其他实习生参与该项目,我们尝试再次重新发布,但出现以下错误:
[IndexOutOfRangeException:索引超出了数组的范围。] XXXXXXX.XXXXXXXRepository..ctor() 中 E:\XXXXXX\YYYYYYY\ZZZZZZ\XXXXXXXRepository.vb:11 XXXXXXX.HomeController..ctor() 中 E:\XXXXXXX\YYYYYY\ZZZZZZ\Controllers\HomeController.vb:10
问题是,此处指向的路径 E:\XXXXXXX....*Controller 或 *Rep 位于开发人员所在的本地计算机上。被制成。就好像某些东西直接硬编码在我们本地计算机的 Rep.VB 和 HomeController.VB 中。它应该指向我们发布整个项目的路径,而不是 E:\XXX\YYY\ZZZ
有人遇到过这个吗?
非常感谢大家 祝你今天过得愉快。
-汤姆
We're trying to publish our little web app here.
I've done it several times in the past and it worked pretty well.
As the tags states, its a MVC ASP.Net project coded with VS2008.
Other interns worked on that project and we tried to re-publish again and we have this error:
[IndexOutOfRangeException: Index was outside the bounds of the array.]
XXXXXXX.XXXXXXXRepository..ctor() in
E:\XXXXXX\YYYYYYY\ZZZZZZ\XXXXXXXRepository.vb:11
XXXXXXX.HomeController..ctor() in
E:\XXXXXXX\YYYYYY\ZZZZZZ\Controllers\HomeController.vb:10
Problem is, the path pointed here E:\XXXXXXX....*Controller or *Rep is located on the LOCAL machine where the dev. is made. It's as if something was hardcoded directly in our local machines in the Rep.VB and HomeController.VB. It should point in the path where we published the whole project wich is not E:\XXX\YYY\ZZZ
Anyone ever encountered this ?
Thanks alot guys
Have a nice day.
-Tom
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这只是有关在源文件中搜索错误的位置的信息,因此这些路径与错误出现无关,它们只是用于调试目的 - 如果您从计算机上进行编译,它们会发生变化,但错误不会消失。
错误消息表明,问题在于,代码尝试访问不存在的数组元素(假设数组有 1 个元素,程序尝试访问第二个元素)。
That is just information about where to search error in source files, so those paths have nothing to do with error appearance, they just for debugging purposes - if you will compile from your machine, they will change, but error will not dissapear.
Error message indicates, that problem is, that code tries to access array element, which is not there (let's say array has 1 element and program tries to access second one).