分享

写回答

发帖

[提问] net网站上传后无法运行

GoDaddy GoDaddy 2389 人阅读 | 7 人回复

发表于 2011-7-6 07:59:32 | 显示全部楼层 |阅读模式

昨天准备上传两个net站点,都放在二级目录绑定了两个二级域名。刚开始显示web。config出错,后来按照网上教程改了,整个代码如下:
<?xml version="1.0"?>
<configuration>
        <appSettings/>
        <connectionStrings/>
    <system.webServer>
        <httpErrors errorMode="Detailed" />
        <asp scriptErrorSentToBrowser="true"/>
    </system.webServer>
    <system.web>
        <customErrors mode="Off"/>
        <compilation debug="true"/>
    </system.web>

    <assemblies>
        <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    </assemblies>
</configuration>
这次页面不报错了,但是网页却无法访问。
显示
500 (Internal Server) Error - We've happened upon a bit of a problem...
就是一张大图片。
请各位高人指点!!

回答|共 7 个

lwbo1987

发表于 2011-7-6 09:02:56 | 显示全部楼层

500错误可能还是这段代码有问题,参考GoDaddy 500错误解决
回复 支持 反对

使用道具 举报

kingsontsao

发表于 2011-7-6 09:05:23 | 显示全部楼层

有没有设置读写权限?
回复 支持 反对

使用道具 举报

sinoking

发表于 2011-7-6 09:14:01 | 显示全部楼层

回复 2# 的帖子

读写权限都设置了。config也按照那个文章修改了。
但还是不行。
我已经用了godaddy一年多了,以前主要是用asp和php。
回复 支持 反对

使用道具 举报

kingsontsao

发表于 2011-7-6 09:24:07 | 显示全部楼层

可能上传的代码 有的地方需要改动一下
回复 支持 反对

使用道具 举报

lpj

发表于 2011-7-6 09:24:39 | 显示全部楼层

刚开始web.config出现什么错误,试试删除这次配置的web.config,看看出现什么情况,应该是配置web.config出现问题了
回复 支持 反对

使用道具 举报

sinoking

发表于 2011-7-6 09:31:20 | 显示全部楼层

回复 6# 的帖子

删除后显示
Server Error in '/pace' 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>

而我的config内容只有这些
<?xml version="1.0"?>
<configuration>
        <appSettings/>
        <connectionStrings/>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
    <assemblies>
        <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    </assemblies>
</configuration>
回复 支持 反对

使用道具 举报

lpj

发表于 2011-7-6 09:49:11 | 显示全部楼层

按照提示修改成以下代码试试
<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>
如果还不行,修改一下代码
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>这段的意思是出现错误时重定向到mycustompage.htm这个页面,你可以修改成你的首页
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则