posted by 준치 2008. 9. 12. 20:01

쉐어포인트 검색서버를 사용하다가 KeywordQuery로 값을 받아오는 단계에서
에러가 났다. 한마디로 어떤 클래스를 참조하는지 명시하라는 말이였다...삽질...

Scopes are usually used in search code. One of the very common errors when working with scopes in search code is as following:

"Calling GetScopeID from a non-Office server binary."

This error occurs when you instantiate the query object, for example:

KeywordQuery kwQuery = new KeywordQuery(site);

To resolve this issue, include the correct namespace when defining the kwQuery object, for example:

Microsoft.Office.Server.Search.Query.KeywordQuery kwQuery = new Microsoft.Office.Server.Search.Query.KeywordQuery(site)

When you skip the namespace, SharePoint tries to call the GetScopeID() from an assembly different than the one it should be using. This especially happens when both of the following namespaces are included in your code:

using Microsoft.SharePoint.Search.Query;
using Microsoft.Office.Server;