WCF data service reference in a WPF project in VS2017

I am having problems adding a link to my WPF project in VS2017. The service itself is a WCF data service using EntityFramework (EntityFrameworkDataService). In VS2013, which I used before, I had no problem adding services to my WPF project. I upgraded to VS2017 last month and recently made some changes to the WCF service and needed a link update in my WPF project. I could not get it to update, so I deleted the link and started trying to re-add the link, and now this error message welcomes me:

The specified OData API cannot be added because the OData API is now only supported by Connected Services.

For more information contact: https://aka.ms/odatavsclientguidance

This means that the link does not contain information about the settings of VS2017. He recommends using the "OData Connected Service" extension, but this extension does not support VS2017 (I tried it, but received the message "incompatible"). I also found the VS WCF Connected Service extension for VS2017, but it does not seem to support WPF projects (or at least I couldn't figure it out).

Has anyone encountered this problem adding a WCF data service link to a WPF project? Any other suggestions I could try?

+4
source share
2 answers

DataSvcUtil.exe, .net

.

"% 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/

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

+4

TGRA, VS2017 dataserviceutil.exe. , :

  • datasvcutil.exe, : %windir%\Microsoft.NET\{{YOUR_PROCESSOR_ARCHITECTURE}}\{{YOUR_FRAMEWORKVERSION}}

  • shift . Open Commandwindow here ( , .

  • datasvcutil.exe, , #: datasvcutil /language:Csharp /out:{{PATH_TO_PROJECT}}/{{SERVICE_NAME}}.cs /uri:{{URL_TO_SERVICE}}.svc

  • datasvcutil.exe, , Visual Basic: datasvcutil /language:VB /out:{{PATH_TO_PROJECT}}/{{SERVICE_NAME}}.VB /uri:{{URL_TO_SERVICE}}.svc

, .

+2

Source: https://habr.com/ru/post/1674124/


All Articles