该应用程序遇到错误. [英] The application has encountered an error.

查看:76
本文介绍了该应用程序遇到错误.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在其自己的子文件夹中将页面添加到现有网站.当我尝试浏览到它时,它给了我这个错误(这是页面上唯一显示的内容):

The application has encountered an error.

我做过的事情:

0)我尝试注释掉后面的所有代码.

1)我已经尝试为其创建一个新的母版页(与使用我原来尝试使用的母版页相反).

2)通过在本地框上创建另一个网站项目,我验证了后面的代码是可以的,并且按预期方式呈现.

3)我将aspx文件中的所有内容都注释掉了,并且按预期呈现时只有以下文本:

I''m trying to add a page to an existing web site in its own sub-folder. When I try to browse to it, it gives me this error (and this is the only thing displayed on the page):

The application has encountered an error.

Things I''ve done:

0) I''ve tried commenting out all of the code behind.

1) I''ve tried creating a new master page for it (as opposed to using the one I original tried to use).

2) I verified that the code behind is okay by creating another web site project on my local box and it renders as expected.

3) I comment out EVERYTHING in the aspx file, and just had the following text, when rendered as expected:

<%=test%>



由于安全限制,我无法进行远程调试,也无法更改web.config.我已经在Google上搜索了错误文本本身,但还没有找到任何可以帮助我解决问题的信息.

如何找出我做错了什么?

编辑===============

如果您要编辑我的问题,请告诉我您所做的更改.

编辑===============

为什么这个问题被否决? Sheesh ...



Due to security restrictions, I cannot remotely debug, and I can''t change the web.config. I''ve google the error text itself, but haven''t yet found anything that can help me through the problem.

How do I find out what I''m doing wrong?

EDIT ===============

If you''re going to edit my qestion, tell me what you changed.

EDIT ===============

Why was this question down-voted? Sheesh...

推荐答案

我们在为我们生成pdf报告的表单上随机得到此错误...解决方案(对我们而言)是执行iisreset,然后一切都神奇地恢复了.ymmv.
We randomly get this error on the form that generates pdf reports for us... the solution (for us) is to perform an iisreset, then it all magically works again... ymmv.


我们现在使用VS2010编写(VB)代码. VS2010允许您使用.Net 4.0构造,即使将网站指定为以.Net 2.0为目标.这意味着VB.Net 2.0中所有必需的(或以前不支持的)东西在.Net 4.0中成为可选的,并且由于intellisense不会让我烦恼,所以我做的某些东西不会运行在网站上,因为服务器上没有.Net 4.0.这导致显示上述一般错误.

根据记录,最有问题的项目是三元条件的处理方式. .Net 2.0要求Iif,但.Net 4.0允许If.
We use VS2010 to write (VB) code now. VS2010 allows you to use .Net 4.0 constructs, even if the web site is specified to target .Net 2.0. This means that all of the stuff that was required (or not previously supported) in VB.Net 2.0 became optional in .Net 4.0, and since intellisense wasn''t barking at me, some of the stuff I did wouldn''t run on the web site because the server doesn''t have .Net 4.0 on it. This caused the generic error described above to be displayed.

For the record, the most problematic item was the way ternary conditions were handled. .Net 2.0 requires Iif, but .Net 4.0 allows If.


转到Visual Studio命令提示符

键入devenv.exe/resetskippkgs

然后再次打开您的项目.


希望对您有所帮助.
go to visual studio command prompt

type devenv.exe/resetskippkgs

And then open your project again.


I hope this will help you.


这篇关于该应用程序遇到错误.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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