ChrisCa
ChrisCa

Reputation: 11006

Access wcf from netcoreapp2.0

I have a asp dotnet core 2.0 project that needs to talk to a downstream WCF service

The proj file is targeting netcoreapp2.0

I have added nuget packages for System.ServiceModel.Primitives and have almost everything I need apart from something in the System.ServiceModel.Configuration namespace which doesnt appear to be available on Nuget

In the past, I have successfully talked to the WCF service in a netcore1.1 project (by making it target net461)

However, this doesnt appear to be an option if you want to take advantage of netCore2.0 functionality. If you target net461 then you cant access netcore2.0 features

Should this be possible?

Am I doing something wrong?

Can you target net461 and also use netcore2.0 features?

or is there a way I can target netcoreapp2.0 and still access System.ServiceModel.Configuration?

Or do I need to target netcoreapp2.0 and do something else that allows me to access System.ServiceModel.Configuration?

thanks

Upvotes: 1

Views: 761

Answers (1)

Martin Ullrich
Martin Ullrich

Reputation: 100543

If you use at least VS 2017 version 15.5, you can add the WCF service as a connected service. The wizard will add the required packages and generate the client code. (in previous VS 2017 versions, you'd need a preview extension).

You can access this wizard from the "Add Connected Service" context menu item:

Add connected service

Connected services

Upvotes: 3

Related Questions