且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Visual Studio 2017 中更新 OData WCF?

更新时间:2022-12-22 10:09:12

官方 Visual您在博文中提到的 Studio Marketplace 代码生成工具现在支持 Visual Studio 2017.

与通常设置 OData 引用的方式的一个显着区别是,以前直接使用 Visual Studio 的添加服务引用"来生成相关代码,安装该工具会添加添加连接的服务".

另请参阅此 GitHub 问题中的讨论.

Trying to update Service Reference in an existing project, I got an error that says,

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

The aka link (http://aka.ms/odatavsclientguidance) leads to http://odata.github.io/odata.net/#OData-Client-Code-Generation-Tool.

There is no instruction for VS 2017.

The instruction below leads me to the OData Connected Serve VS extension. (https://marketplace.visualstudio.com/items?itemName=laylaliu.ODataConnectedService)

And it appears that extension cannot be installed in VS 2017.

Scroll to the bottom of the extension description page, we will see all the questions about its VS 2017 version.

So the question: is that OData extension the only to update OData Service in VS 2017? What walk around do we have?

The official Visual Studio Marketplace code generation tool, which you refer to in your post, now supports Visual Studio 2017.

One notable difference from how one would normally go about setting up OData references is that where one would previously use Visual Studio's "Add Service Reference" directly to generate the relevant code, installing the tool adds a "Add Connected Service" instead.

See also the discussion in this GitHub issue.