3

私の Web.Debug.config には、次のものがあります。

  <system.web>
    <!--
      In the example below, the "Replace" transform will replace the entire 
      <customErrors> section of your Web.config file.
      Note that because there is only one customErrors section under the 
      <system.web> node, there is no need to use the "xdt:Locator" attribute.

      <customErrors defaultRedirect="GenericError.htm"
        mode="RemoteOnly" xdt:Transform="Replace">
        <error statusCode="500" redirect="InternalError.htm"/>
      </customErrors>
    -->
  </system.web>

これを変更して、構成ファイルの値を次のように変更するにはどうすればよいですか。

<customErrors mode="Off" /> to <system.web>web.config ファイルで

4

2 に答える 2

5

これを次のように変更するだけです:

  <customErrors mode="Off" xdt:Transform="Replace">
  </customErrors>
于 2013-01-10T19:22:18.297 に答える
4

Eonasdanは正しい方向に進んでいます。

これを行う正しい方法は、デバッグ構成でエラーを「オフ」に設定することです。

Web.Release.configで、変換を使用します。

<customErrors mode="Off" xdt:Transform="Replace">
</customErrors>

このように、コードを本番環境にプッシュするときは、Visual StudioドロップダウンのWeb.Release.configファイルを使用すると、変換によってweb.configファイルにあるものが置き換えられます。

于 2013-01-10T22:04:54.893 に答える