配置错误 - 无法读取配置文件... [英] Config Error - Cannot read configuration file...

查看:248
本文介绍了配置错误 - 无法读取配置文件...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从IIS8.0收到此错误

HTTP错误500.19 - 内部服务器错误

模块 IIS Web Core
通知未知

处理程序尚未确定

错误代码 0x80070005

配置错误由于权限不足而无法读取配置文件

配置文件 \\?\ C:\ Users\oluwaseun \Documents\Visual Studio 2012 \Projects\CBTDLCF \web.config

请求的网址 http:// localhost: 2020 /

物理路径

登录方法尚未确定

登录用户尚未确定





我想为什么这种情况持续存在是因为我在我的服务器上安装了Wamp Server的实例系统也使用localhost。有什么我做错了吗?



我的web.config文件



 <?  xml     version   =  1.0 < span class =code-summarycomment>   encoding   =  utf-8  >  
<! -
有关如何配置ASP的详细信息。 NET应用程序,请访问
http://go.microsoft.com/fwlink/?LinkId=169433
- >

< 配置 >
< configSections >
<! - 有关实体框架配置的详细信息,请访问http://go.microsoft.com/fwlink/?LinkID=237468 - >
< 部分 名称 = < span class =code-keyword> entityFramework type = System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection,EntityFramework,Version = 4.4.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089 requirePermission = false / >
< / configSections < span class =code-keyword>>
< connectionStrings >
< add name = DefaultConnection providerName = System.Data.Sql客户端 connectionString = 数据源=(LocalDb)\ v11.0;初始目录= aspnet-CBTDLCF-20140930120545;集成安全性= SSPI; AttachDBFilename = | DataDirectory | \ aspnet-CBTDLCF-20140930120545。 mdf / >


< add name = CBTDLCFDBEntities connectionString = metadata = res://*/CBTDLCFDBModel.csdl | res://*/CBTDLCFDBModel.ssdl | res://*/CBTDLCFDBModel.msl; provider = System.Data.SqlClient; provider connection string =& quot; data source =(LocalDB)\ v11.0; attachdbfilename = | DataDirectory | \CBTDLCFDB.mdf; integrated security = True; connect timeout = 30; MultipleActiveResultSets = True; App = EntityFramework& quot ; providerName = System.Data.EntityClient / > < / connectionStrings >
< system.web >
< 编译 targetFramework = 4.0 >
< 程序集 >
< add 程序集 = System.Data.Entity,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089 / >
< / assemblies >
< / compilation > ;
< 身份验证 mode = 表单 >
< 表格 loginUrl = 〜/ Account / Login 超时 = 2880 defaultUrl = 〜/ / >
< / authentication >
< profile defaultProvider = DefaultProfileProvider >
< 提供商 >
< add name = DefaultProfileProvider type = System.Web.Providers.DefaultProfileProvider,System.Web .Providers,版本= 1.0.0 .0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35 connectionStringName = DefaultConnection applicationName = / / >
< / providers >
< / profile >
< 成员资格 defaultProvider = DefaultMembershipProvider >
< 提供商 >
< ; add name < span class =code-keyword> = DefaultMembershipProvider type = System.Web.Providers.DefaultMembershipProvider,System.Web.Providers, Version = 1.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35 connectionStringName = DefaultConnection enablePasswordRetrieval = false enablePasswordReset = true requiresQuestionAndAnswer = false requiresUniqueEmail = false < span class =code-attribute> maxInvalidPasswordAttempts = 5 minRequiredPasswordLength = 6\" <跨度class =code-attribute> minRequiredNonalphanumericCharacters = 0 passwordAttemptWindow = 10 applicationName < span class =code-keyword> = / / >
< / providers >
< / membership >
< roleManager defaultProvider = DefaultRoleProvider >
< 提供商 >
< add name = DefaultRoleProvider type = System.Web.Providers.DefaultRoleProvider,System.Web.Providers,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35 connectionStringName = DefaultConnection applicationName < span class =code-keyword> = / / >
< / providers >
< / roleManager >
<! -
如果要部署到具有多个Web服务器实例的云环境,
您应该更改会话状态模式从InProc到Custom。此外,
更改名为DefaultConnection的连接字符串以连接到SQL Server的实例
(包括SQL Azure和SQL Compact),而不是SQL Server Express。
- >

< sessionState mode = InProc customProvider = DefaultSessionProvider >
< 提供商 >
< add 名称 = DefaultSessionProvider type = System.Web.Providers.DefaultSessionStateProvider,System.Web.Providers,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35 connectionStringName = DefaultConnection / >
< / providers >
< / sessionState >
< / system.web >
< system.webServer >
< modules runAllManagedModulesForAllRequests = true / >
< / system。 webServer >
< 运行时 >
< assemblyBinding xmlns = urn:schemas-microsoft-com:asm。 v1 >
< dependentAssembly >
< assemblyIdentity name = DotNetOpenAuth.Core publicKeyToken = 2780ccd10d57b246 / >
< bindingRedirect oldVersion = 1.0.0.0-4.0.0.0 newVersion = 4.1.0.0 / >
< / dependentAssembly >
< dependentAssembly >
< assemblyIdentity 名称 = DotNetOpenAuth.AspNet publicKeyToken = 2780ccd10d57b246 / >
< bindingRedirect oldVersion = 1.0 .0.0-4.0.0.0 newVersion = 4.1.0.0 / >
< / dependentAssembly >
< / assemblyBinding >
< / runtime >
< entityFramework >
< defaultConnectionFactory type = System.Data.Entity.Infrastructure.LocalDbConnectionFactory,EntityFramework >
< 参数 >
< 参数 value = v12.0 / >
< / parameters >
< / defaultConnectionFactory >
< / entityFramework >
< / configuration < span class =code-keyword>>

解决方案

在IIS中查看应用程序池正在使用的用户。然后将其更改为具有权限的用户或授予所需权限。



或者更好的是,不要将代码留在用户文件夹中并移至C:\inetpub\wwwroot

I am getting this error from my IIS8.0
HTTP Error 500.19 - Internal Server Error
Module IIS Web Core
Notification Unknown
Handler Not yet determined
Error Code 0x80070005
Config Error Cannot read configuration file due to insufficient permissions
Config File \\?\C:\Users\oluwaseun\Documents\Visual Studio 2012\Projects\CBTDLCF\web.config
Requested URL http://localhost:2020/
Physical Path
Logon Method Not yet determined
Logon User Not yet determined


I guess why this persists is because I have an instance of Wamp Server installed on my system which also uses the localhost too. Is there something I'm doing wrong???

my web.config file

<?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>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <connectionStrings>
    <add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-CBTDLCF-20140930120545;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-CBTDLCF-20140930120545.mdf" />


  <add name="CBTDLCFDBEntities" connectionString="metadata=res://*/CBTDLCFDBModel.csdl|res://*/CBTDLCFDBModel.ssdl|res://*/CBTDLCFDBModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(LocalDB)\v11.0;attachdbfilename=|DataDirectory|\CBTDLCFDB.mdf;integrated security=True;connect timeout=30;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /></connectionStrings>
  <system.web>
    <compilation targetFramework="4.0">
      <assemblies>
        <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      </assemblies>
    </compilation>
    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login" timeout="2880" defaultUrl="~/" />
    </authentication>
    <profile defaultProvider="DefaultProfileProvider">
      <providers>
        <add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
      </providers>
    </profile>
    <membership defaultProvider="DefaultMembershipProvider">
      <providers>
        <add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
      </providers>
    </membership>
    <roleManager defaultProvider="DefaultRoleProvider">
      <providers>
        <add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
      </providers>
    </roleManager>
    <!--
            If you are deploying to a cloud environment that has multiple web server instances,
            you should change session state mode from "InProc" to "Custom". In addition,
            change the connection string named "DefaultConnection" to connect to an instance
            of SQL Server (including SQL Azure and SQL  Compact) instead of to SQL Server Express.
      -->
    <sessionState mode="InProc" customProvider="DefaultSessionProvider">
      <providers>
        <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" />
      </providers>
    </sessionState>
  </system.web>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" />
        <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" />
        <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="v12.0" />
      </parameters>
    </defaultConnectionFactory>
  </entityFramework>
</configuration>

解决方案

In IIS look at which user your application pool is using. Then either change it to a user that has permissions or grant the required permissions.

Or, even better, don't leave your code in the Users folder and move to c:\inetpub\wwwroot.


这篇关于配置错误 - 无法读取配置文件...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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