spsite

Sharepoint SPSite

不问归期 提交于 2019-12-20 02:15:09
问题 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?? 回答1: Check that you are building against the correct target. I.e. x86 vs x64. I get this error

Sharepoint SPSite

末鹿安然 提交于 2019-12-01 20:32:23
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?? 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. Do you have your permissions set up correctly? Check

Best Pattern for AllowUnsafeUpdates

廉价感情. 提交于 2019-11-30 12:09:04
问题 So far, in my research I have seen that it is unwise to set AllowUnsafeUpdates on GET request operation to avoid cross site scripting. But, if it is required to allow this, what is the proper way to handle the situation to mitigate any exposure? Here is my best first guess on a reliable pattern if you absolutely need to allow web or site updates on a GET request. Best Practice? protected override void OnLoad(System.EventArgs e) { if(Request.HttpMethod == "POST") { SPUtility.ValidateFormDigest