ビジュアル Web 開発者 | サイトはローカルでは動作しますが、Web サーバーではランタイム エラーが発生します

ビジュアル Web 開発者 | サイトはローカルでは動作しますが、Web サーバーではランタイム エラーが発生します

Microsoft Visual Web Developer 2010 Expressを使用してサイトを構築しようとしています。構築したマシンでサイトをコンパイルすると、デバッグを使用して動作しますが、それを提供するWebサーバーではランタイムエラーが発生します。最初はデフォルトのテンプレートを使用していて、途中で作業しています。そのため、アクセスしようとするとhttp://gametek.me/V5/MSVWD でデバッグを使用するとランタイム エラーが発生します。問題なく動作します。何が問題なのか、何かアイデアはありますか?

プログラムのデフォルトコード

<%@ Page Title="Home Page" Language="VB" MasterPageFile="~/Site.Master" AutoEventWireup="false"
    CodeFile="Default.aspx.vb" Inherits="_Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Welcome to ASP.NET!
    </h2>
    <p>
        To learn more about ASP.NET visit <a href="http://www.asp.net" title="ASP.NET Website">www.asp.net</a>.
    </p>
    <p>
        You can also find <a href="http://go.microsoft.com/fwlink/?LinkID=152368&amp;clcid=0x409"
            title="MSDN ASP.NET Docs">documentation on ASP.NET at MSDN</a>.
    </p>
</asp:Content>


ウェブ.config

<?xml version="1.0"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>

  <connectionStrings>
    <add name="ApplicationServices"
         connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
         providerName="System.Data.SqlClient" />
  </connectionStrings>

  <system.web>
    <compilation debug="false" strict="false" explicit="true" targetFramework="4.0" />

    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login.aspx" timeout="2880" />
    </authentication>

    <membership>
      <providers>
        <clear/>
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
             enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
             maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
             applicationName="/" />
      </providers>
    </membership>

    <profile>
      <providers>
        <clear/>
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
      </providers>
    </profile>

    <roleManager enabled="false">
      <providers>
        <clear/>
        <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
      </providers>
    </roleManager>

  </system.web>

  <system.webServer>
     <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
</configuration>
<!-- Web.Config Configuration File -->

エラーのスクリーンショット ローカル接続時にエラーが発生しました

答え1

編集済み

パーサーエラーメッセージを読みましたか?

There are multiple root elements. Line 13, position 4

基本的に、web.config XMLツリーの11行目で閉じて、次のように宣言します。</configuration>

その行をすべて削除するか、ファイルの末尾に移動する必要があります。

ちなみに、このファイルはそのままでは開発で動作することはありません。有効な XML ではありません。

関連情報