Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sharepoint SPSite

I am trying to create a spsite of object for sharepoint search but i am getting exception in production as website not found

SPSite site = new SPSite("sitename");
ServerContext scon = ServerContext.GetContext(site);
SearchContext srchcontext = SearchContext.GetContext(scon);
Scopes sc = new Scopes(srchcontext);

It throws exception site not found i have checked the name of site it exixts.

Any Help??

like image 703
kailash Avatar asked Jun 30 '26 00:06

kailash


1 Answers

Check that you are building against the correct target. I.e. x86 vs x64. I get this error when I build against x86 and try and run against x64.

like image 111
Nat Avatar answered Jul 03 '26 01:07

Nat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!