Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF Data Service reference in WPF Project in VS2017

I'm having issues adding a service reference to my WPF project in VS2017. The service itself is a WCF Data Service using EntityFramework (EntityFrameworkDataService). In VS2013 that I was using before, I didn't have any issues adding services to my WPF project. I upgraded to VS2017 last month, and recently made some changes to the WCF service and needed to refresh the reference in my WPF project. I couldn't seem to get it to refresh so I deleted the reference and started trying to re-add the reference and now I'm greeted with this error message:

The specified OData API cannot be added because OData APIs are now only supported with Connected Services.

For more information, please see: https://aka.ms/odatavsclientguidance

That provided link does not have any info regarding VS2017 setups. It recommends to use the 'OData Connected Service' extension but that extension does not support VS2017 (tried it but got a "not compatible" message). I also found the 'VS WCF Connected Service' extension for VS2017, but it doesn't appear to support WPF projects (or atleast I couldn't figure it out).

Has anyone ran into this issue with adding a WCF Data Service reference to a WPF project? Any other suggestions that I could try?

like image 696
Brian Avatar asked Apr 05 '17 17:04

Brian


People also ask

How do I add a Web service reference in Visual Studio 2017?

To add a Web reference to a project. In Solution Explorer, right-click the name of the project to add the Web service to and then click Add Web Reference. The Add Web Reference dialog box is displayed. In the URL box, enter the URL of the Web service to use.

How do I add a WCF reference in Visual Studio 2015?

Right click on References -> Add Connected Service. Click 'Find more services...' at the bottom of window. Search for 'Visual Studio WCF Connected Service' and install. After VS restart, by clicking on 'Add Connected Service' you will be able to do what you wanted.


1 Answers

I typically generate my clients via the DataSvcUtil.exe which is part of the .net framework

e.g.

"%windir%\Microsoft.NET\Framework\v4.0.30319\DataSvcUtil.exe" /dataservicecollection /version:2.0 /language:CSharp /out:c:\temp\DataService.cs /uri:http://localhost:16584/DataService/

The MSDN docs: https://msdn.microsoft.com/en-us/library/ee383989(v=vs.110).aspx

like image 59
TGRA Avatar answered Oct 01 '22 00:10

TGRA