【问题标题】:error CS1759 while building VSIX project in visual studio 2015在 Visual Studio 2015 中构建 VSIX 项目时出现错误 CS1759
【发布时间】:2015-08-23 12:09:39
【问题描述】:

我创建了一个新的 VSIX 项目,添加了一个新的自定义命令项,尝试构建,但出现了这 2 个错误:

错误 CS1759:无法从程序集中嵌入互操作类型 'Microsoft.VisualStudio.OLE.Interop,版本=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 因为它是 缺少任何一个 'System.Runtime.InteropServices.ImportedFromTypeLibAttribute' 属性或 'System.Runtime.InteropServices.PrimaryInteropAssemblyAttribute' 属性。

错误 CS1759:无法从程序集“Microsoft.VisualStudio.Shell.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”嵌入互操作类型,因为它缺少“System.Runtime.InteropServices.ImportedFromTypeLibAttribute”属性或“System.Runtime.InteropServices.PrimaryInteropAssemblyAttribute”属性。

可能是什么问题?

如果有帮助,我遵循了这个 Microsoft 指南: https://msdn.microsoft.com/en-us/library/cc138589.aspx

谢谢!

  • 编辑: 我将引用“...shell.interop”和“...OLE.interop”的属性将“Embed Interop Types”字段从True更改为False,它可以工作。有人知道为什么吗? 谢谢。

【问题讨论】:

  • 同样的经历:真 -> 假,它可以正常工作

标签: c# .net visual-studio visual-studio-2015


【解决方案1】:

正如作者提到的,将这两个程序集的 Embed Interop Types 属性更改为 false。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-08-07
    • 1970-01-01
    • 2015-11-01
    • 2017-01-15
    • 2018-10-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多