【发布时间】:2011-04-11 22:27:01
【问题描述】:
我一直在尝试做一个简单的restful wcf 服务来返回JSON。如果我将在开发服务器中运行它,它就可以工作。但是,如果我将它部署在 IIS 7.5 上,当我使用 http://localhost:70
访问它时会出现此错误HTTP 错误 500.19 - 内部服务器 错误 请求的页面不能 访问,因为相关 该页面的配置数据是 无效。
配置错误配置部分 无法读取“标准端点” 因为它缺少一个部分 声明
这是我的配置文件:这是VS2010生成的默认文件。
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</modules>
</system.webServer>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<standardEndpoints>
<webHttpEndpoint>
<!--
Configure the WCF REST service base address via the global.asax.cs file and the default endpoint
via the attributes on the <standardEndpoint> element below
-->
<standardEndpoint name="LocationService" helpEnabled="true" automaticFormatSelectionEnabled="true"/>
</webHttpEndpoint>
</standardEndpoints>
</system.serviceModel>
</configuration>
我是 WCF 的新手,特别是在 .net 4.0 和 IIS 7.5 上。
有人可以帮忙吗?或者任何人都经历过同样的事情并且已经解决了?
【问题讨论】:
标签: wcf web-config c#-4.0