CardCaptor 發表於 2006-1-3 14:39

asp.net 執行問題

小弟寫了個.aspx檔案
是由html form讀取資料去這個檔案
再寫入去access的資料庫

但在執行時就整了段:

Server Error in '/Web' 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>


但小弟已經有一個web.config
內容如下:

<?xml version="1.0"?>
<!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
        <appSettings/>
        <connectionStrings/>
        <system.web>
                <customErrors mode="Off"/>    <!--它叫小弟加上去就在這裡-->
                <!--
            Set compilation debug="true" to insert debugging
            symbols into the compiled page. Because this
            affects performance, set this value to true only
            during development.
      -->
                <compilation debug="true"/>
                <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
      -->
                <authentication mode="Windows"/>
                <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.

      <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
      </customErrors>
      -->
        </system.web>
</configuration>

其實是怎麼的一回事?
謝!!

Dolphin 發表於 2006-1-3 22:23

在自己 local IIS 在 VS.net debugger run 有無問題?

CardCaptor 發表於 2006-1-3 22:39

原帖由 Dolphin 於 2006-1-3 22:23 發表
在自己 local IIS 在 VS.net debugger run 有無問題?

無問題...
(因為開始了"DEBUG程序"...)

Dolphin 發表於 2006-1-3 23:21

在 IIS server 用 localhost 入去,睇唔睇到個 program 死乜?

不如試下係 appSettings add 個 key 落去個 web.config 再試下係個 program 度拎番出黎,睇下佢係咪用緊你個 web.config?

CardCaptor 發表於 2006-1-4 00:29

原帖由 Dolphin 於 2006-1-3 23:21 發表
在 IIS server 用 localhost 入去,睇唔睇到個 program 死乜?

不如試下係 appSettings add 個 key 落去個 web.config 再試下係個 program 度拎番出黎,睇下佢係咪用緊你個 web.config?

現在的情況:

之前那個抄回來都用不好
轉用呢個web.config:

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

就可以在localhost行都沒問題...
個問題實時解決了
再來的就靠自己debug了

謝閣下的回應~~
頁: [1]
查看完整版本: asp.net 執行問題