首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

小弟我的所有aspx网页打开出错了

2012-02-17 
我的所有aspx网页打开出错了?我一简单网站,发布后,在本地IIS测试正常,但是上传后,出错:ServerErrorin/xunz

我的所有aspx网页打开出错了?
我一简单网站,发布后,在本地IIS测试正常,但是上传后,出错:
Server   Error   in   '/xunzhi '   Application.
--------------------------------------------

Runtime   Error  
Description:   An   application   error   occurred   on   the   server.   The   current   custom   error   settings   for   this   application   prevent   the   details   of   the   application   error   from   being   viewed   remotely   (for   security   reasons).   It   could,   however,   be   viewed   by   browsers   running   on   the   local   server   machine.  

Details:   To   enable   the   details   of   this   specific   error   message   to   be   viewable   on   remote   machines,   please   create   a   <customErrors>   tag   within   a   "web.config "   configuration   file   located   in   the   root   directory   of   the   current   web   application.   This   <customErrors>   tag   should   then   have   its   "mode "   attribute   set   to   "Off ".


<!--   Web.Config   Configuration   File   -->

<configuration>
        <system.web>
                <customErrors   mode= "Off "/>
        </system.web>
</configuration>
 

Notes:   The   current   error   page   you   are   seeing   can   be   replaced   by   a   custom   error   page   by   modifying   the   "defaultRedirect "   attribute   of   the   application 's   <customErrors>   configuration   tag   to   point   to   a   custom   error   page   URL.


<!--   Web.Config   Configuration   File   -->

<configuration>
        <system.web>
                <customErrors   mode= "RemoteOnly "   defaultRedirect= "mycustompage.htm "/>
        </system.web>
</configuration>
 
我用   asp.net   探针测试此虚拟空间支持   2.0   ,不知道为什么打不开?

[解决办法]
兄弟,看下你上传的bin下的dll的字节数是否为0。或者某些关键文件字节数是否为0,我之前也碰到类似情况,检查了N久,发现是这个问题。顿时晕倒
[解决办法]
用到数据库了吗?数据库链接是否配置好了?
将web.config修改为外网可以看错误。看到底什么问题。
<customErrors mode= "Off "/>
[解决办法]
应该是虚拟路径的问题吧,我也经常遇到这种问题。每次替换更新后的网站就这样,郁闷了。
[解决办法]
不关什么 你先把这个该了
<customErrors mode= "Off "/>

该了这个以后你会看到它具体报什么错~~~
[解决办法]
This <customErrors> tag should then have its "mode " attribute set to "Off ".
然后在看具体错误信息。
------解决方案--------------------


现在知道问题在哪里了,我们就进一步分析
有以下可能
1 mappath后,得到的路径不是你上传的路径。你可以先将连接字符串Response.Write()显示出来看看(将数据库操作相关的代码先注释),然后用File.Exists()看一下那个文件是否存在。
2 文件存在,有可能打不开,没有权限。asp.net程序执行在一个特殊用户下,他一般可以读文件,但是不可以写文件。打开数据库时,要求有写的权限的,所以打不开。
3 连接字符串写错

热点排行