0

I'm having several issues with my WCF client in that the client Reference.cs is empty and the only error I get on the build is the useless generic message:

Severity Code Description Project File Line Suppression State Warning Custom tool warning: Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter Error: The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='IBrokerWcf'] MyWeb.Setup C:\Users\me\Projects\MyWeb 3.x\MyWeb v3.x\MyWeb.Setup\Service References\BrokerWcfSvc\Reference.svcmap 1

When I load the Service in the WCF Test Client, all of the advertised async methods error out (see image) with "This Operation is not supported in the WCF Test Client because it uses type System.Threading.Tasks.Task'1"

All of this previously worked fine. Not sure what changed to send it all sideways.

WCF Test Client

Chuck
  • 41
  • 1
  • 5

1 Answers1

0

System.ServiceModel.Description.DataContractSerializerMessageContractImporter Error: The located assembly's manifest definition does not match the assembly reference.

As the error says, the manifest definition of the locating assembly does not match the assembly reference. You need to check the components. Did you click "Reuse types in referenced assemblies" when adding a service reference.

This Operation is not supported in the WCF Test Client because it uses type System.Threading.Tasks.Task'1"

The "error" you are seeing is just a limitation of the test tool that comes with visual studio, both functions call the same server side function so there is no compelling force to make Microsoft add support. There is no actual error. If you really want to test the async version you will need to write your own test client that calls the function.
Error : not supported in WCF Test client because it uses type System.Threading.Tasks

Lan Huang
  • 613
  • 2
  • 5
  • Thank you for your response, The generic message doesn't tell me a whole lot. Which assembly? What assembly reference? Yes, the "Reuse types in Reference.." is checked. Where do I look to locate this manifest? As far as the WCF Test Client, this did not present errors when the Web Service problems weren't happening that's why I assumed it might be related. – Chuck Jun 28 '22 at 12:15
  • The error message indicates the source of the error. `Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='IBrokerWcf'] MyWeb.Setup C:\Users\me\Projects\MyWeb 3.x\MyWeb v3.x\MyWeb.Setup\Service References\BrokerWcfSvc\Reference.svcmap 1`. You'd better run the wcf service and see if the service runs successfully. – Lan Huang Jun 29 '22 at 05:13
  • When I run that service from the WCF Test Client it returns data as expected. The Client wont build because the data contract references aren't available in the Reference.cs file. – Chuck Jun 29 '22 at 11:38
  • How can I manually perform the "Update Service Reference" I use in VS2019 using the SVCUTIL.EXE? What parameter switch should I use to include all of the MyService?.xsd, MyService?.disco, etc? – Chuck Jun 29 '22 at 12:53
  • I think you can check the documentation.https://learn.microsoft.com/en-us/dotnet/framework/wcf/servicemodel-metadata-utility-tool-svcutil-exe?redirectedfrom=MSDN – Lan Huang Jun 30 '22 at 07:26
  • Have you tried cleaning and rebuilding? You can check [this thread](https://stackoverflow.com/questions/3000209/service-reference-not-generating-client-types), it provides a lot of methods. – Lan Huang Jun 30 '22 at 07:40
  • I have tried the Clean without success. Is there a way to capture the exact parameters or cmd line used by Visual Studio 2019 when a Web Services is Add or Updated? How can I exactly mimic the svcutil command line parameters that VS2019 is using? – Chuck Jul 04 '22 at 15:10