Simen S
Simen S

Reputation: 3205

Generating the System.ServiceModel configuration section for WCF Data Service client

When I use the "Add Service Reference" utility in Visual Studio to connect to a WCF Data Service (OData), visual Studio doesn't generate an App.config file with the System.ServiceModel section for me. (The proxy class is generated fine). Is this normal?

Is there still a way to have this config generated automatically? The WCF service in question is secured and I therefore struggle with authentication issues if I try to to use the command line svcutil.exe with the /config option.

Upvotes: 0

Views: 1345

Answers (1)

Vitek Karas MSFT
Vitek Karas MSFT

Reputation: 13320

svcutil.exe cannot be used with WCF Data Services (OData), there's a datasvcutil.exe which is used instead.

The Add Service Reference for OData should not generate anything into your app.config as it doesn't need it. To use it, you just new up the generated context class and pass in the URI of the service.

If your OData endpoint required authentication though, the Add Service Reference doesn't support that though, so I'm surprised it works for you.

Upvotes: 1

Related Questions