【发布时间】:2019-08-20 07:14:25
【问题描述】:
我有一个使用古老的 ASMX 服务的项目。坐在 .Net Framework 4.6.1 时,我可以添加对服务的引用,我没有遇到任何问题。但是一旦我将项目升级到 4.7 或 4.7.x,我就会开始收到此错误:
'FlightSchedule': member names cannot be the same as their enclosing type
我得到这三种类型。除了代码中的错误之外,如果我尝试删除和添加服务或更新现有服务,则会收到以下警告:
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='DIAFlightScheduleHttpGet']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:service[@name='DIAFlightSchedule']/wsdl:port[@name='DIAFlightScheduleHttpGet']
D:\Projects\...\Connected Services\FISAirline\Reference.svcmap 1
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='DIAFlightScheduleHttpPost']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:service[@name='DIAFlightSchedule']/wsdl:port[@name='DIAFlightScheduleHttpPost']
D:\Projects\...\Connected Services\FISAirline\Reference.svcmap 1
Custom tool warning: Cannot import wsdl:binding
Detail: The required WSDL extension element 'binding' from namespace 'http://schemas.xmlsoap.org/wsdl/http/' was not handled.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='DIAFlightScheduleHttpGet']
D:\Projects\...\Connected Services\FISAirline\Reference.svcmap 1
Custom tool warning: Cannot import wsdl:binding
Detail: The required WSDL extension element 'binding' from namespace 'http://schemas.xmlsoap.org/wsdl/http/' was not handled.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='DIAFlightScheduleHttpPost']
D:\Projects\...\Connected Services\FISAirline\Reference.svcmap 1
我无法弄清楚这一点。如果我用谷歌搜索警告,有更新 app.config 的指针,但没有协议可供我删除。如果我搜索错误,我找不到任何相关的内容。
我需要更新到最新的框架 v4.8。
非常感谢任何帮助。
【问题讨论】: