无法嵌入程序集“...\Microsoft.Search.Interop.dll”中的互操作类型因为它缺少 GuidAttribute 属性

发布于 2024-08-26 16:44:24 字数 245 浏览 2 评论 0原文

在我创建的新项目中添加对 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

我ぃ本無心為│何有愛 2024-09-02 16:44:24

转到 Microsoft.Search.Interop 的“属性”窗口,并将“嵌入互操作类型”属性更改为 False。

Go to the Properties window for Microsoft.Search.Interop and change the "Embed Interop Type" property to False.

桜花祭 2024-09-02 16:44:24

是的,我最终想通了。显然,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!

白日梦 2024-09-02 16:44:24

我有同样的问题。我做错的是,我将引用 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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文