sivaL
sivaL

Reputation: 1992

How to update the WCF Service Reference in .NET CORE Web project?

I have added the WCF Service reference by

Service References --> Add Connected Service --> WCF Service Preview

Its working fine, Service reference added successfully. Now I have modified the WCF Service (added new web methods) and would like to update the Service Reference which I have arleady created.

In .net framework project I was able to achieve by clicking on "Update Service Reference" . Do we have this feature in .NET CORE Project?

Upvotes: 13

Views: 19095

Answers (4)

skoley
skoley

Reputation: 310

IF your WCF URL is changed follow the below.

Navigate to "projectfolder\Connected Services\servicename\ConnectedService.json" Edit the json file

"ExtendedData": {
    "inputs": [
      "https://example.com/apis.asmx" (put your new url and save)
    ],

Then follow the steps below. In VS2022 - > Project menu -> Connected Services -> Manage Connected Services. From '...' menu on service reference, select Edit and go through steps to regenerate Reference.cs.

or you can do this https://learn.microsoft.com/en-us/dotnet/core/additional-tools/dotnet-svcutil-guide?tabs=dotnetsvcutil2x

Upvotes: 0

stricq
stricq

Reputation: 866

This answer is to promote tjmoore's reply:

In VS2022 - > Project menu -> Connected Services -> Manage Connected Services. From '...' menu on service reference, select Edit and go through steps to regenerate. – tjmoore Nov 11, 2022 at 16:46

Upvotes: 5

Simon_Weaver
Simon_Weaver

Reputation: 146208

Right click on the folder icon that contains your ConnectedService.json

enter image description here

Upvotes: 16

Jake Wierzba
Jake Wierzba

Reputation: 76

Try adding the connected service again with the exact same Namespace. Don't delete the existing one. It will overwrite it automatically. I just did it and connected to a different instance of my service and it recreated the entire reference.

Upvotes: 3

Related Questions