Service Reference Failure – Cannot import wsdl:portType

Got an interesting exception whilst adding a service reference to a project, as seen below


Custom tool warning: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: Could not load file or assembly ‘NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c’ or one of its dependencies. The system cannot find the file specified.

Luckily there’s an easy fix – right mouse click on the reference under the Service References section of the solution and select Configure Service References

ConfigureServiceReference

And as shown, select Reuse types in specified referenced assemblies and check the NLog assembly.

I need to update this post with the whys and wherefores of this change, but it works.