Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在Visual Studio 2017中将引用更新为VSConstants_C#_Visual Studio_Interop_Code Generation_Visual Studio 2017 - Fatal编程技术网

C# 如何在Visual Studio 2017中将引用更新为VSConstants

C# 如何在Visual Studio 2017中将引用更新为VSConstants,c#,visual-studio,interop,code-generation,visual-studio-2017,C#,Visual Studio,Interop,Code Generation,Visual Studio 2017,我有一个我们在Visual Studio 2013-2015中使用的文件生成器工具,它基于Microsoft.VisualStudio.Interop中的IVsSingleFileGenerator模式。我安装了Visual Studio 2017 sdk并加载了该项目,但发现所有VSConsants值现在都缺少引用,因此当前上下文中不存在名称为“VSConstants”的错误。我一直在尝试查找有关此枚举值可能发生的情况的引用,但未能找到有关MSDN中这些值应如何转换或常量引用可能已到何处的任何

我有一个我们在Visual Studio 2013-2015中使用的文件生成器工具,它基于Microsoft.VisualStudio.Interop中的IVsSingleFileGenerator模式。我安装了Visual Studio 2017 sdk并加载了该项目,但发现所有VSConsants值现在都缺少引用,因此当前上下文中不存在名称为“VSConstants”的
错误。我一直在尝试查找有关此枚举值可能发生的情况的引用,但未能找到有关MSDN中这些值应如何转换或常量引用可能已到何处的任何信息

引发错误的常量:

VSConstants.S_OK
VSConstants.E_FAIL

参考文献移动了吗?是否需要使用另一组常量?

添加对Microsoft.VisualStudio.Shell.15.0汇编的引用 或者只需安装Microsoft.VisualStudio.Shell.15.0


您也可以查看。

来自,比如Microsoft.VisualStudio.Shell.14.0。作为VS SDK的一部分,它还不能用于VS2017。即使在引用它之后,我仍然会遇到此错误:严重性代码描述项目文件行抑制状态错误编译转换:在命名空间“Microsoft.VisualStudio”中找不到类型名称“VSConstants”。该类型已被转发到MealSo.VisualStudio.Sel.Frror,版本=16.0.0.0,Cule=中性,PuxKeKeTebug=B03F5F7F11D50A3A’考虑添加对该程序集的引用。我对这个程序集添加了一个附加引用:“微软.VisualStudio.shell框架”,它起作用了。我还安装了.NET4.6.1SDK。