Installing OData v4 Client Code Generator in Visual Studio 2019

跟風遠走 提交于 2019-12-07 00:26:27

问题


I made a OData service and I want to make a client program to call this service. I want to use OData v4 Client Code Generator, but I cannot install it in Visual Studio 2019 and I can only install it in vs2017.

How can I install it in vs2019?


回答1:


Since Rahul's download link is expired (and according to the comment of Mostafa, it was missing a feature), I reupload a working version of the extension for Visual Studio 2019:

https://gofile.io/?c=kXvXoR

Some notes about upgrading the vsix file:

1) If you unzip the file, edit the contents (actually even without editing anything), rezip it and finally rename it vsix, it does NOT work. You have to edit the file contents of vsix directly with a program like 7zip.

2) To edit the file contents, I used the following link: https://github.com/OData/odata.net/issues/1485
I copy the content changes here again:

extension.vsixmanifest

  <Installation>
    <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[14.0, 17.0)" />
  </Installation>
  <Prerequisites>
    <Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,17.0)" DisplayName="Visual Studio core editor" />
  </Prerequisites>

manifest.json

"dependencies": { "Microsoft.VisualStudio.Component.CoreEditor": "[15.0,17.0)" }

catalog.json

    "dependencies": {
        "Microsoft.VisualStudio.Component.CoreEditor": "[15.0,17.0)"
    },

3) After creating the proxy/client, you will notice that the Reference file does not compile because there are some API changes in "Microsoft.OData.Edm":
- EdmxReader has been renamed to CsdlReader
- For Date type just remove .Library from namespace prefixes. (rename all occurences)




回答2:


Currently, OData v4 Client Code Generator is not available for VS 2019 in VS Marketplace. However, you can try the following:

Method 1: Exporting your VS 2017 extension to VS 2019, using extension manager extension.

How to: Using Extension Manager 2017

Method 2: You can build the VSIX extension targeting VS 2019.

How to: Updates to .vsixmanifest

Project Source: https://github.com/OData/odata.net



来源:https://stackoverflow.com/questions/56003404/installing-odata-v4-client-code-generator-in-visual-studio-2019

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!