When trying to use .net core 2.1 rc1 to add a service reference for WCF, I am experiencing the following error:
Error:An unknown error occurred while invoking the service metadata component. Failed to generate service reference
I have checked and the only security in place is Transport, no message security.
The logs are as follows:
[05/24/2018 12:28:28],59,Importing web service metadata ...
[05/24/2018 12:28:28],27,Number of service endpoints found: 2
[05/24/2018 12:28:28],9,Scaffolding service reference code ...
[05/24/2018 12:28:28],71,Executing command [C:\Users\me\AppData\Local\Temp\WCFConnectedService\2018_May_24_12_28_28\svcutil_starter]
"dotnet new console --no-restore --force --type project --language C# --output . --name svcutil_starter"
[05/24/2018 12:28:30],9,Executing command [C:\Users\me\AppData\Local\Temp\WCFConnectedService\2018_May_24_12_28_28\svcutil_starter]
"dotnet restore --ignore-failed-sources"
[05/24/2018 12:28:31],35,Executing command [C:\Users\me\AppData\Local\Temp\WCFConnectedService\2018_May_24_12_28_28\svcutil_starter]
"dotnet "svcutil" --additionalprobingpath "C:\Users\me\\.nuget\packages" "C:\Users\me\AppData\Local\Temp\WCFConnectedService\2018_May_24_12_28_28\SvcUtilParams.txt""
[05/24/2018 12:28:32],52,An unknown error occurred while invoking the service metadata component.
Failed to generate service reference.
[05/24/2018 12:28:32],11,Done.
Not sure why this worked for me:
Not sure why this worked. Without creating the second solution in a different instance of Visual Studio, it was not working.
Hope this helps.
Till 2018-07-31, it still has problems for NET Core 2.1.x to add a service reference for WCF in VS2017 (v15.7.5). You can create Net 2.0.x project to create the connected service, it'll work perfect. Then copy the 'Connected Services' sub-directory in project to new NET core v2.1.x project.
Installs the following packages via NuGet such as this image:
NuGet Packages for Connected Services
Compiled successfully in NET Core 2.1.x project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With