The configuration section #39;system.servicemodel#39; cannot be read because it is missing a section declaration(无法读取配置部分“system.servicemodel,因为它缺少部分声明)
问题描述
我有点问题.我的旧网络服务器(windows 2003)已被替换为 2008 R2.我已经获得了一个管理员帐户,可以做任何我想做的事,但我不是这方面的专家.我将角色配置为具有应用程序开发和 Web 服务器 (iis7).
I have somewhat of a problem. My old webserver (windows 2003) have been replaced, with a 2008 R2. I have been given an admin account on it, and can do whatever I want, but I am no expert on this area. I configured the roles to have application developement and Web server (iis7).
但是,我的网站运行的是 .NET4,而角色只安装了 3.5.所以我尝试在服务器上手动安装 .NET4.我的问题是,由于我的 web.config 中的 System.ServiceModel 部分,我的网站无法运行.我已确保它在 .NET4 应用程序池中运行.
BUT, my website runs .NET4, and the role only installed 3.5. So I have attempted to install .NET4 manually, on the server. My problem is, my website will not work on it, due to the System.ServiceModel section in my web.config. I have made sure it runs in .NET4 application pool.
我认为这是一个 WCF 问题,但我不知道如何解决它.我已经尝试了我在谷歌上找到的所有东西.aspnet_regis、ServiceModelReg.exe 等.我什至尝试过重新安装网络服务器角色,但每次尝试进入站点设置时仍然出现此错误.
I assume this is a WCF problem, but I can't grasp how to solve it. I have tried everything I found on google. aspnet_regis, ServiceModelReg.exe and so on. I have even tried re-installing the webserver role, but I still get this error, everytime I try to enter the sites setup.
我希望这里有一些专家,他们知道如何解决这个问题.
I'm hoping there are some experts here, who know how to fix this.
推荐答案
显然 IIS7 需要一个 System.WebServer 部分,即使它是空的.将以下内容添加到我的 web.config 文件中解决了我的问题.
Apparently IIS7 needs a System.WebServer section, even if it is empty. Adding the following to my web.config file fixed my problem.
<system.webServer>
</system.webServer>
这篇关于无法读取配置部分“system.servicemodel",因为它缺少部分声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:无法读取配置部分“system.servicemodel",因为它缺少部分声明
基础教程推荐
- c# Math.Sqrt 实现 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- 如何激活MC67中的红灯 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- 将 XML 转换为通用列表 2022-01-01