我已经使用.net 4.5创建了一个wcf服务,并且实现它在第一个工作正常。
出于某种原因,我从我的项目中删除了该服务,然后再次添加它。当我添加它时,我得到了自定义工具警告。
我尝试创建一个新项目并在那里实施没有任何问题。 所有服务合同都已添加。
我的默认项目失败的事情如下:
警告显示:
Warning 16 Custom tool warning: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: ISerializable type with data contract name 'FileInfo' in namespace 'http://schemas.datacontract.org/2004/07/System.IO' cannot be imported. The data contract namespace cannot be customized for ISerializable types and the generated namespace 'itsperfect.Extreme.Web.Booking.MailClient' does not match the required CLR namespace 'System.IO'. Check if the required namespace has been mapped to a different data contract namespace and consider mapping it explicitly using the namespaces collection.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='IMailService'] C:\Dev\TFS\Booking\Main\src\Web.Booking\Service References\MailClient\Reference.svcmap 1 1 Web.Booking
Warning 17 Custom tool warning: Cannot import wsdl:binding
Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on.
XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='IMailService']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='BasicHttpBinding_IMailService'] C:\Dev\TFS\Booking\Main\src\Booking\Service References\MailClient\Reference.svcmap 1 1 Web.Booking
Warning 18 Custom tool warning: Cannot import wsdl:port
Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.
XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='BasicHttpBinding_IMailService']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:service[@name='MailService']/wsdl:port[@name='BasicHttpBinding_IMailService'] C:\Dev\TFS\Booking\Main\src\Web.Booking\Service References\MailClient\Reference.svcmap 1 1 Web.Booking
我尝试过的事情:
已删除的服务参考&再次添加。
删除了“重新使用参考类型”,重新启动。
删除服务后清理项目,然后重新添加。
答案 0 :(得分:1)
发现错误! Kendo.Mvc.dll是导致问题的程序集,将其作为引用删除并再次添加。