Visual Studio extension custom command error: "Object does not match target type"

Visual Studio extension custom command error: "Object does not match target type"

我想创建一个 Visual Studio 扩展。更准确地说是一个额外的菜单项。我使用本教程作为指南:

Visual Studio Extensibility: Creating Visual Studio VSIX package extension

问题是在成功创建VSIX项目后,我尝试添加自定义命令。将自定义命令添加到我的项目时出现以下错误:

按下 "ok" 后,我的项目中添加了一个 .cs 文件。该文件几乎没有引用错误。我也尝试过自己引用源文件,但是没有成功。

它还给出了以下输出:

Adding a new custom command 'Command1' to the project 'MockGenExtension': The custom command requires a VS package. No existing VS packages found in the project. A new VS package 'Command1Package' will be created for the custom command.

我已经重新安装了 Visual Studio 和 SDK,但没有任何效果。

升级到 Visual Studio 2017 为我解决了这个问题。