asp.net – 即使在IIS的web.config中使用标签后,也会出现重复的部分错误
|
我有一个网站在另一个网站的子目录中运行.它们运行在单独的应用程序池中.这两个站点正在运行不同版本的Entity Framework.所以在web.config中的子目录我有: <remove name="entityFramework"/> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection,EntityFramework,Version=4.4.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089" requirePermission="false" /> 但即使使用< remove>标签我仍然收到此错误: Section or group name 'entityFramework' is already defined. Updates to this may only occur at the configuration level where it is defined. 我也把< location>标签在父web.config中,尽可能: <location path="." inheritInChildApplications="false"> <位置>标签存在于父web.config的< entityFramework>部分. 我已经在IIS的applicationHost.config文件(System32和SysWOW64中的这两个文件)中放置了enableConfigurationOverride =“false”. 如何防止子目录中的网站看到父实体框架标签? 编辑 IIS版本:7.5.7600.16385 从父web.config: <configSections> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection,Version=6.0.0.0,PublicKeyToken=b77a5c561934e089" requirePermission="false" /> </configSections> 升 <location path="." inheritInChildApplications="false">
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory,EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices,EntityFramework.SqlServer" />
</providers>
</entityFramework>
</location>
从小孩web.config: <configSections>
<remove name="entityFramework"/>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection,PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection,Microsoft.Practices.EnterpriseLibrary.Common,Version=5.0.505.0,PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
</configSections>
升 <entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory,EntityFramework" />
</entityFramework>
编辑2 关于使用< clear />:这会导致关于缺少节声明的一系列错误.如果我添加了100行的段声明,我得到错误:已检测到ASP.NET设置不适用于集成管理管道模式.即使我使用< validation validateIntegratedModeConfiguration =“false”/>在< system.webServer> ;. 解决方法你能确认你是否尝试清除而不是删除问题仍然持续吗?<configSections>
<clear/>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection,PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
</configSections>
你可能会读更多here 希望这将有助于您 (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- 强制ASP.NET应用程序从bin而不是GAC加载程序集
- asp.net-mvc-4 – 复杂模型上的MVC Html.DisplayNameFor
- asp.net-mvc-3 – 不明显的客户端验证规则中的验证类型名称
- asp.net-mvc – 我如何UnitTest自定义ActionFilter?
- ASP.NET MembershipProvider加密/解密
- asp.net – 有没有比升级到Visual Studio 2010 Ultimate更便
- asp.net-mvc – Visual Studio总是能够在源代码视图而不是设
- asp.net-mvc – ASP.Net MVC Razor Views – 在构建时缩小H
- 使用StateServer的ASP.NET会话混合(SCARY!)
- asp.net-mvc – 如何让Visual Studio 2012检测虚拟目录是否
