无法嵌入程序集“...\Microsoft.Search.Interop.dll”中的互操作类型因为它缺少 GuidAttribute 属性
在我创建的新项目中添加对 Microsoft.Search.Interop.dll 库的引用时,出现此错误。
Microsoft.Search.Interop.dll 是一个库,它提供了一些有用的 API 来与 Windows 搜索进行通信。我使用它是为了将文件夹添加到系统索引器。
其他人是否遇到此错误,如果是,我应该如何解决它?
如果这很重要的话,我在 Windows Server 2008 上使用 VS2010 RC。
I get this error when adding a reference to the Microsoft.Search.Interop.dll library in a new project that I created.
Microsoft.Search.Interop.dll is a library that provides some useful API to communicate with Windows Search. I use it in order to add a folder to the system indexer.
Did anybody else get this error, and if so, how should I go about solving it?
I'm using VS2010 RC on a Windows Server 2008 if that is important.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
转到 Microsoft.Search.Interop 的“属性”窗口,并将“嵌入互操作类型”属性更改为 False。
Go to the Properties window for Microsoft.Search.Interop and change the "Embed Interop Type" property to False.
是的,我最终想通了。显然,Windows Search SDK 代码示例中的某个位置有一个 Microsoft.Search.Interop.dll 文件。
您可以在此处获取代码示例,然后只需使用 Windows 搜索即可找到它。
希望有帮助。
干杯!
Yeah, I eventually figured it out. Apparently, there is a Microsoft.Search.Interop.dll file somewhere within the Windows Search SDK code examples.
You can get the code examples here, and just use the windows search to find it.
Hope it helps.
Cheers!
我有同样的问题。我做错的是,我将引用 dll 的“Embed Interop Type”属性标记为 True,而不是标记为“Copy Local”。当我将“嵌入互操作类型”重置为 False 时,错误消失了,一切正常。希望这对某人有帮助。谢谢!
I had the same issue. What I had done wrong is, I had marked "Embed Interop Type" property of referencing dll to True instead of marking for "Copy Local". The error went away when I reset "Embed Interop Type" to False, it all worked fine. Hope this helps somebody.Thanks!