IIS7 下超出 Web 配置大小限制 0x80070032
我有一个 web.config
文件,在我当前在 IIS7 上运行的解决方案中该文件相当大。
它在我的开发服务器上运行完美,但是我遇到错误 0x80070032
“配置错误无法读取配置文件,因为它超出了最大文件大小”
我当前的解决方案使用非常大的 <代码> web.config 文件。我的 CMS 应用程序的架构需要大量的配置设置。
有什么方法可以扩展此大小限制,或者我可以将 web.config
文件拆分为更小的文件吗?
I have a web.config
file which is quite large in my current solution running on IIS7.
It's working perfect on my dev server however I encounter the error 0x80070032
"Config Error Cannot read configuration file because it exceeds the maximum file size"
My current solution uses a very large web.config
file. The architecture of my CMS application requires a large number of configuration settings.
Is there some way to extend this size limit or can I split the web.config
file down into smaller files?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否尝试添加此注册表项:
HKLM\SOFTWARE\Microsoft\InetStp\Configuration
然后设置此 DWORD 值:
MaxWebConfigFileSizeInKB
如果您的系统运行 64 位 Windows,但您的应用程序池在 32 位模式下运行,那么您可能需要在以下位置进行设置:
HKLM\SOFTWARE\Wow6232Node\Microsoft\InetStp\Configuration
如果您的
web.config
文件因以下原因而过大大量重写规则,那么您可以将它们分成自己的文件:Have you tried adding this registry key:
HKLM\SOFTWARE\Microsoft\InetStp\Configuration
Then set this DWORD value:
MaxWebConfigFileSizeInKB
If your system is running 64 bit windows but your application pool is running in 32-bit mode then you may need to set this in:
HKLM\SOFTWARE\Wow6232Node\Microsoft\InetStp\Configuration
If your
web.config
file is oversized because of a large number of rewrite rules then you could separate these into their own files:您的 CMS 解决方案是 Sitecore 吗?如果是这样,Sitecore 有两个选项可以将其配置从主 web.config 文件中分离出来。
Sitecore 支持使用标记以包含来自单独文件的部分配置。您只需将标记配置所在的位置:
然后在的父级处启动配置。 (在本例中为 sitecore)在包含文件中:
Sitecore 本身在其标准配置中使用了此内容,因此您只需在其标准配置文件中查找即可看到相当多的示例。
您的其他选项是提取一些配置并将其放入进入 app_config/includes 目录。在运行时,Sitecore 将在其中查找任何 .config 文件,然后将文件中的任何配置添加到主配置中。
此配置文件需要具有完整的 Sitecore 配置结构。
Is your CMS solution Sitecore? If so, Sitecore has two options for splitting its config out of the main web.config file.
Sitecore supports using the <sc:include> tag to include a part of the configuration from a seperate file. You just put the <sc:include> tag wherever the configuration would go:
Then you start the configuration at the parent of <sc:include> (in this case sitecore) in the include file:
Sitecore themselves use this in their standard configuration so you can see quite a few examples of this just by looking for in their standard configuration file.
Your other option is to pull out some configuration and put it into the app_config/includes directory. At runtime Sitecore will look for any .config files in there and then add any configuration in the file to the main config.
This configuration file needs to have the full Sitecore configuration structure.