in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

This Blog

Syndication

All About SharePoint - S.S. Ahmed - MVP Microsoft SharePoint

All About SharePoint, as the name suggests, is all about SharePoint. It has articles, tutorials, source code, FAQs, and tips about SharePoint, InfoPath, C#, Microsoft Office, SQL Server, XML, etc.

Fix "calling GetScopeID from a non-Office server binary" error

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;

Published Sep 03 2007, 09:40 PM by ssa
Filed under: , ,

Comments

 

SharePoint 2007 link love 09-04-2007 at Virtual Generations said:

Pingback from  SharePoint 2007 link love 09-04-2007 at  Virtual Generations

September 4, 2007 1:19 AM
 

Blogger Loser » Blog Archive » Fix “calling GetScopeID from a non-Office server binary” error said:

Pingback from  Blogger Loser  » Blog Archive   » Fix “calling GetScopeID from a non-Office server binary” error

September 4, 2007 4:55 AM

Leave a Comment

(required )  
(optional )
(required )  
Add

About ssa

MOSS MVP - Over 8 years experience. 4 years SharePoint experience!

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts