【问题标题】:Problem Deploying new application部署新应用程序的问题
【发布时间】:2011-11-22 21:04:15
【问题描述】:

我是新手,请见谅。我正在做的是将我的应用程序部署到服务器上,它在我的本地机器上运行良好,但是当我尝试访问服务器时出现错误。这是下面的错误和我的 web.config 文件。我不知道我做错了什么。

配置错误 说明:处理服务此请求所需的配置文件期间发生错误。请查看下面的具体错误详细信息并适当地修改您的配置文件。

解析器错误消息:在应用程序级别之外使用注册为 allowDefinition='MachineToApplication' 的部分是错误的。此错误可能是由于虚拟目录未在 IIS 中配置为应用程序所致。

来源错误:

Line 18: <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, 
          PublicKeyToken=B03F5F7F11D50A3A"/>

Line 19: <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 
          PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>
Line 20:        <authentication mode="Forms">
Line 21:            <forms loginUrl="~/Account/Login.aspx" timeout="2880"/>
Line 22:        </authentication>



    <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>
       <customErrors mode="Off"></customErrors>
    <compilation debug="true" strict="false" explicit="true" 
             targetFramework="4.0">
    <assemblies>
    <add assembly="System.Web.Extensions.Design, 
             Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, 
              PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 
             PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>
    <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>

【问题讨论】:

    标签: vb.net


    【解决方案1】:

    我似乎记得当您将应用程序部署到现有站点的子文件夹时发生了这种情况,它是 web.config 包含一个适用于整个站点/应用程序的设置,并且无法修改基于每个文件夹

    It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level

    我会和你一起玩

    <system.webServer> 
        <modules runAllManagedModulesForAllRequests="true"/> 
    </system.webServer>
    

    设置。尝试将其移至站点的根 web.config 并查看您的位置,或将其完全删除。

    另外,请参阅(仅来自快速谷歌)

    Error: allowDefinition='MachineToApplication' beyond application level

    http://geekswithblogs.net/ranganh/archive/2005/04/25/37609.aspx

    ASP.NET IIS Web.config [Internal Server Error]

    http://forums.asp.net/t/1031775.aspx/1

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-04-15
      • 2012-05-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-07
      相关资源
      最近更新 更多