【发布时间】: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