Cannot embed interop types from assembly “…\Microsoft.Search.Interop.dll” because it is missing the GuidAttribute attribute

霸气de小男生 提交于 2019-12-08 15:58:49

问题


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.


回答1:


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




回答2:


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!




回答3:


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!



来源:https://stackoverflow.com/questions/2514813/cannot-embed-interop-types-from-assembly-microsoft-search-interop-dll-beca

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!