我有一个在.net4.0上运行良好的WCF服务 但几天前我将代码升级到.net4.5并编译了它。该服务工作正常,并听取特定的端口。但是,当我尝试创建一个代理客户端时,我收到一个错误(我能够创建一个代理客户端"旧"在.net4.0上编译的WCF服务) 这是app.config -
<service behaviorConfiguration="ExternalSystemsService.WExternalSystemsBehavior" name="ExternalSystemsService.WExternalSystems">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="ExternalSystemsTCP" name="ExternalSystemsServiceTcpBindingEndpoint" contract="ExternalSystemsService.IWExternalSystems"/>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" name="MexTcpBindingEndpoint" contract="IMetadataExchange"/>
<host>
<baseAddresses>
<add baseAddress="net.tcp://fm6gmup4006:3220/ExternalSystemsService"/>
</baseAddresses>
</host>
</service>
这是我收到的错误(它与不同的端点无关,如果我在app.config中编写使用端点,则会出现相同的错误) -
C:\Program Files (x86)\Microsoft Visual Studio 11.0>svcutil.exe /language:cs /ou
t:JULeSService.cs /config:JULeSService.config net.tcp://havjules01:3020/External
SystemsService
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.18020]
Copyright (c) Microsoft Corporation. All rights reserved.
Attempting to download metadata from 'net.tcp://havjules01:3020/ExternalSystemsS
ervice' using WS-Metadata Exchange. This URL does not support DISCO.
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.18020]
Copyright (c) Microsoft Corporation. All rights reserved.
Error: Cannot obtain Metadata from net.tcp://havjules01:3020/ExternalSystemsServ
ice
If this is a Windows (R) Communication Foundation service to which you have acce
ss, please check that you have enabled metadata publishing at the specified addr
ess. For help enabling metadata publishing, please refer to the MSDN documentat
ion at http://go.microsoft.com/fwlink/?LinkId=65455.
WS-Metadata Exchange Error
URI: net.tcp://havjules01:3020/ExternalSystemsService
Metadata contains a reference that cannot be resolved: 'net.tcp://havjules01
:3020/ExternalSystemsService'.
<?xml version="1.0" encoding="utf-16"?><Fault xmlns="http://www.w3.org/2003/
05/soap-envelope"><Code><Value>Sender</Value><Subcode><Value xmlns:a="http://www
.w3.org/2005/08/addressing">a:ActionNotSupported</Value></Subcode></Code><Reason
><Text xml:lang="en-US">The message with Action 'http://schemas.xmlsoap.org/ws/2
004/09/transfer/Get' cannot be processed at the receiver, due to a ContractFilte
r mismatch at the EndpointDispatcher. This may be because of either a contract m
ismatch (mismatched Actions between sender and receiver) or a binding/security m
ismatch between the sender and the receiver. Check that sender and receiver hav
e the same contract and the same binding (including security requirements, e.g.
Message, Transport, None).</Text></Reason></Fault>
If you would like more help, type "svcutil /?"