首页 新闻 会员 周边 捐助

WCF 提示Specified value has invalid Control characters

0
悬赏园豆:100 [已关闭问题] 关闭于 2011-12-14 09:29

新建了一个非常简单的WCF Service,但是在IE中浏览时,提示下面的错误:

环境是 windows7  vs2010 sp1  IE9

The service encountered an error.

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:System.ArgumentException: Specified value has invalid Control characters.Parameter name: value   at System.Net.WebHeaderCollection.CheckBadChars(String name, Boolean isHeaderValue)   at System.Net.WebHeaderCollection.Add(String name, String value)   at System.Collections.Specialized.NameValueCollection.Add(NameValueCollection c)   at System.ServiceModel.Activation.HostedHttpContext.HostedRequestContainer.System.ServiceModel.Channels.HttpRequestMessageProperty.IHttpHeaderProvider.CopyHeaders(WebHeaderCollection headers)   at System.ServiceModel.Channels.HttpRequestMessageProperty.get_Headers()   at System.ServiceModel.Description.ServiceMetadataExtension.TryGetHttpHostAndPort(Uri listenUri, Message request, String& host, Int32& port)   at System.ServiceModel.Description.ServiceMetadataExtension.GetDynamicAddressWriter(Message request, Uri listenUri, Boolean removeBaseAddress)   at System.ServiceModel.Description.ServiceMetadataExtension.GetWriteFilter(Message request, Uri listenUri, Boolean removeBaseAddress)   at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.TryHandleMetadataRequest(Message httpGetRequest, String[] queries, Message& replyMessage)   at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.ProcessHttpRequest(Message httpGetRequest)   at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.Get(Message message)   at SyncInvokeGet(Object , Object[] , Object[] )   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc)   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc)   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc)   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc)   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
wcf
伊默宁的主页 伊默宁 | 菜鸟二级 | 园豆:205
提问于:2011-12-14 08:47
< >
分享
所有回答(2)
0

已经找到原因了。 IIS安装时候没有选上 Framework3.5中的Http activation 和 Non-Http activation 。

伊默宁 | 园豆:205 (菜鸟二级) | 2011-12-14 09:29
0

请问楼主,您用的是IIS哪个版本,我也遇到这问题了!!!

Ismuse | 园豆:202 (菜鸟二级) | 2012-06-04 21:34

IIS7

支持(0) 反对(0) 伊默宁 | 园豆:205 (菜鸟二级) | 2012-06-21 16:03
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册