When you are making a Console Application and you are using SharePoint API, sometimes when you are creating a new SPSite object you may receive an error, which says that the site is not found. You have to check a couple of things: – In the properties of the project, at Build section, set Platform
Category: SharePoint
A couple of days ago I wrote some code for creating a web application, configuring Claims Authentication and adding some alternate urls. I will share here the code with you: SPWebApplicationBuilder builder = new SPWebApplicationBuilder(SPFarm.Local); // This class is used for creating the web application. SPWebApplication webApp; builder.Port = 80; // Custom port number builder.AllowAnonymousAccess
Maybe one day in your SharePoint developer life you want to set the site Output Cache properties in your code. You can achieve that be using SiteCacheSettingsWriter class like in the following piece of code: SiteCacheSettingsWriter cacheSettingsWriter = new SiteCacheSettingsWriter(web.Site); cacheSettingsWriter.EnableCache = true; cacheSettingsWriter.SetAnonymousPageCacheProfileId(web.Site, 2); cacheSettingsWriter.SetAuthenticatedPageCacheProfileId(web.Site, 3); cacheSettingsWriter.SetFarmCacheFlushFlag(); cacheSettingsWriter.Update();
SPSiteDataQuery has a bug. Not working when you are trying to retrieve a Multi User Field (“UserMulti”). The Where clause is working when using this type of field, but not getting the values in the DataTable when calling spWeb.GetSiteData(query). You can read more about this here.
I have read in the last 1,2 years that buying a SSD is a big deal for a developer, especially for a SharePoint developer. If you have a computer with an I7 processor and at least 8 GB ram, all you need is a SSD and then you can start your SharePoint work, but…. I have