无法读取配置部分“system.servicemodel",因为它缺少部分声明

The configuration section #39;system.servicemodel#39; cannot be read because it is missing a section declaration(无法读取配置部分“system.servicemodel,因为它缺少部分声明)
本文介绍了无法读取配置部分“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",因为它缺少部分声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)
Bind multiple parameters from route and body to a model in ASP.NET Core(在ASP.NET Core中将路由和主体中的多个参数绑定到一个模型)
Custom model binding in AspNet Core WebApi?(AspNet Core WebApi中的自定义模型绑定?)
How to minify in .net core mvc view?(如何在.Net核心MVC视图中缩小?)