显示web配置错误一塌糊涂 [英] shown web configure error mess

查看:65
本文介绍了显示web配置错误一塌糊涂的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,

我已经在C#& amp;上创建了一个asp.net项目。 SQL服务器数据库。



但是当我配置这个项目在wwwroot中发布时。然后它显示以下错误。



配置错误
描述:处理所需配置文件时出错为此请求提供服务。请查看下面的具体错误详细信息并相应地修改配置文件。

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

来源错误:


第11行:< system.web >
第12行:< 编译 debug = true targetFramework = 4.0 < span class =code-keyword> / >
第13行:< 身份验证 mode = 表单 >
第14行:< 表格 loginUrl = 〜/ Login.aspx timeout = 2880 path = / / >
第15行:< / authentication >


源文件:C :\inetpub\wwwroot \ new_nps \web.config行:13









我的web.comfig代码如下所示;;;;;;;;;;;;;;;;;;;;;;;;; $ $ $ $ $ $ $ $ $ $ $ $ $ bn <? xml version = 1.0 编码 = utf-8 < span class =code-summarycomment>? >
<! -
有关如何配置ASP.NET应用程序的更多信息,请访问
http:// go.microsoft.com/fwlink/?LinkId=169433
- >

< configuration >
< connectionStrings >
< add name = ApplicationServices connectionString = data source = .\SQLEXPRESS; Integrated Security = SSPI; AttachDBFilename = | DataDirectory | \ aspnetdb.mdf; User Instance = true providerName = System.Data.SqlClient / >
< add name = MemberConnectionString connectionString = 数据源= PRODIP;初始目录=成员;持久安全信息=真;用户ID = sa;密码= prodip @ km providerName = System.Data.SqlClient / >
< / connectionStrings >
< system.web >
< 编译 debug = true targetFramework = 4.0 / >
< 身份验证 mode = 表单 >
< span class =code-keyword>< 表格 loginUrl = 〜/ Login.aspx timeout = 2880 path = / / >
< < span class =code-leadattribute> / authentication >
< 成员资格 >
< 提供商 >
< clear / >
< add name = AspNetSqlMembershipProvider type = System.Web.Security.SqlMembershipProvider connectionStringName = ApplicationServices < span class =code-attribute> enablePasswordRetrieval = enablePasswordReset = true requiresQuestionAndAnswer = false requiresUniqueEmail = false < span class =code-attribute> maxInvalidPasswordAttempts = 5 minRequiredPasswordLength = 6 minRequiredNonalphanumericCharacters = < span class =code-keyword> 0 passwordAttemptWindow = 10 applicationName = / / >
< / providers >
< / membership >
< 个人资料 >
< providers >
< clear / >
< add name = AspNetSqlProfileProvider < span class =code-attribute> type = System.Web.Profile.SqlProfileProvider connectionStringName = ApplicationServices applicationName = / / > ;
< / providers >
< / profile >
< roleManager 已启用 = false >
< 提供商 >
< 清除 / >
< add name = AspNetSqlRoleProvider type = System.Web.Security.SqlRoleProvider connectionStringName = ApplicationServices applicationName = / / >
< add name = AspNetWindowsTokenRoleProvider type = System.Web.Security.WindowsTokenRoleProvider applicationName = / / >
< / providers >
< / roleManager >
< pages >
< 控件 >
< add tagPrefix = ajaxToolkit assembly = AjaxControlToolkit 命名空间 = AjaxControlToolkit < span class =code-attribute> / >
< / controls >
< / pages >
< / system.web >
< system.webServer >
< modules runAllManagedModulesForAllRequests = true / >
< / system.webServer >
< / configuration >









请帮我刷新asp.net。 。

解决方案

您无法在IIS中管理文件夹,检查虚拟目录的可用性,或者您是否在文件夹中提供了错误的文件夹或父文件夹。物理路径。


要创建虚拟目录,请右键单击Web项目,然后选择属性,然后选择Web。选择使用本地IIS Web服务器,然后提供项目URL,即http:// localhost /< virtual_directory_name>然后单击创建虚拟目录。然后在IIS中,您可以看到您的网站站点>默认网站> Virtual_directory_name。然后你可以设置默认文件等



希望这有帮助


任何人都可以帮我编辑/更正我的web.config file..please帮帮我..


Dear all,
I have created one asp.net project base on C# & SQL server data base.

but when i configure this project for publish in wwwroot. then it shown the following error.

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS.

Source Error:


Line 11:   <system.web>
Line 12:     <compilation debug="true" targetFramework="4.0" />
Line 13:     <authentication mode="Forms">
Line 14:    <forms loginUrl="~/Login.aspx" timeout="2880"  path="/"/>
Line 15:    </authentication>


Source File: C:\inetpub\wwwroot\new_nps\web.config    Line: 13





My web.comfig code is as bellow;;;;;;;;;;;;

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <connectionStrings>
    <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
    <add name="MemberConnectionString" connectionString="Data Source=PRODIP;Initial Catalog=Member;Persist Security Info=True;User ID=sa;Password=prodip@km" providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
     <authentication mode="Forms">
    <forms loginUrl="~/Login.aspx" timeout="2880"  path="/"/>
    </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>
    <pages>
      <controls>
        <add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
      </controls>
    </pages>
  </system.web>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
  </system.webServer>
</configuration>





Please help me i m new in asp.net..

解决方案

You are not able to manage your folders in IIS ,check the availability of your Virtual Directories or may be you have given the wrong folder or parent folder in the physical path.


To create virtual directory, right click on web project, select properties then web. Choose 'Use Local IIS web server' then give project url i.e http://localhost/<virtual_directory_name> and click 'Create Virtual Directory'. Then in the IIS you can see your website Sites>Default Web site>Virtual_directory_name. Then you can set default document etc

Hope this helps


can any one help me to edit/correction my web.config file..please help me..


这篇关于显示web配置错误一塌糊涂的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆