Visual Studio "Add REST API Client" 不工作

Visual Studio "Add REST API Client" not working

我无法在安装了所有最新更新和 Azure Tools v2.9 的 Visual Studio 2015 中使用添加...REST API 客户端...选项。当我 select 选项时,我会看到正确的对话框以提供 url 或 swagger json 文件的文件路径。无论我 select 选择哪个选项,我都会收到以下错误消息:

Generating client code and adding to project started Generate client code for REST API with following parameters: REST API Name: ToDoListAPIClient, Base namespace: ToDoListAPI, Metadata file path: C:\Users\ken\AppData\Local\Temp\WebToolsAutoRest\ToDoListAPIClient1702032141192827\swagger.json Exception: Could not load file or assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified. Generating client code and adding to project failed Adding REST API client for failed

我该如何解决这个问题?

确保通过 运行 命令下载正确版本的 Newtonsoft.Json 软件包: PM> install-package Newtonsoft.Json -版本 7.0.1

然后复制Newtonsoft.Json程序集(版本7.0.0.0)到C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE.

这应该可以解决这个问题。