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-mvc – ASP.NET Web优化 – 无需捆绑即可缩小
- Asp.Net MVC自定义控件 – 容器
- asp.net – LINQ to SQL Web应用程序最佳实践
- 在asp.net中使用SQL查询中的变量(C#)
- asp.net – 如何向IIS添加反射权限或将其添加到web.config?
- asp.net – 如何禁用.NET事件日志警告?
- asp.net – 我的项目引用了3个不同版本的mscorlib.dll
- asp.net – Application_Error – GetLastError()或GetLast
- asp.net – 如何使用返回类型的System.Action?
- ASP.NET MVC,Node.JS.他们可以互动吗?
- asp.net-mvc – 如何根据枚举值检查单选按钮
- ASP.NET – 将网站投入生产的基本清单
- ASP.NET Core 在 Swagger UI 中显示自定义的 Hea
- asp.net-mvc – 使用URL重写时Url.Action不正确
- ASP.NET – Ajax Calendar Extender CSS继承自表
- ASP.NET站点在开发期间自动登录
- asp.net – IIS 7.5无法打开处理程序映射?
- asp.net-mvc-3 – mvc3 OutputCache RemoveOutpu
- asp.net-mvc – 带数据注释的KendoUI网格默认值
- asp.net-mvc – ASP.NET MVC和IIS 5