Posts

An attempt was made to load an assembly with an incorrect format microsoft.sharepoint.search.dll

Image
I recently came across the following error message when I gotten compile the project in release - after success in debug An attempt was made to load an assembly with an incorrect format microsoft.sharepoint.search.dll The solution is simple go to Project Properies -> Build ... and trun off the Generate serialization assembly Generate serialization assembly Yours, Roi

OAuth 2.0 protocol

Image
Today to share information of sharepoint with Facebook, Twitter, linkedin, google or live edu you need to create a SSO (single sign-on). As it seems, in sharepoint 15 (2013) we get a new protocol called OAuth 2.0. What is OAuth 2.0 protocol? OAuth 2.0 is an upgrade of Frotokl OAuth from 2006 (a more advanced generation evolution of the protocol). It allows us to authenticate a user and give it a specific and temporary approval of our application. OAuth specification is being developed in IETF WG and shell based on OAuth. The protocol has been implemented in applications of Android and iPhone user receiving the operating system (Yes. .. Android does not send the details of your gmail any foreign entity). Think now about a world in which the SP talking to him Ioser of Facebook, and get him to only specific permissions to share some information. SharePoint  15 will be continued... Roi

Enable-SPFeature: The Feature is not a Farm Level Feature and is not found in a Site level defined by the Url

Image
After running the following command Enable-SPFeature-Identity DocumentSet-URL http://url I received the following error Enable-SPFeature: The Feature is not a Farm Level Feature and is not found in a Site level defined by the Url ... Why ??? It happened to me because I copied some files at the time manually (not using the solution). The team system locks the files to ReadOnly . And the command fails (the readonly found only a deep excavation in the log files of sharepoint) The solution: D isables the ReadOnly for all the files in sub folders. It can be found here: Uncheck read only file for all sub folder with PowerShell I use this code at 14\Template folder Thanks, Roi

Uncheck read only file for all sub folder with PowerShell

Image
This time I'll introduce PowerShell code that disables the read only for all the files in sub folders ( Recurse) The code: $ Path = "your root folder" $ Files = Get-ChildItem $Path -Recurse ForEach  ($ File in $ Files ) {    Write-Host   "File: "  $ File  "IsReadOnly: "  $ File .IsReadOnly    if ($ File .Attributes -ne "Directory" -and $ File .Attributes -ne "Directory, Archive" )    {        if  ( $ File .IsReadOnly -eq  $ true  )       {            try             {                Set-ItemProperty - path  $ File .FullName  - name IsReadOnly - value $ false                write-host  "file:"   $ File .FullName "is now false read only"  -foregroundcolor "magenta"      ...

System.Web​.HttpUnhan​dledExcept​ion: Failed to load viewstate

Image
Event: Getting error while loading control - the GridView in CreateChildControl that uses ViewState Error: System.Web.HttpUnhandledException: Failed to load viewstate . The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request. The solution: Transfer the load of the ViewState to PreRender (from CreateChildControl) The lesson: Better understand the life-sycle of loading (seems that no matter the experience, are always making mistakes of a beginner :) ...) Cheers, Roi

SharePoint 2010: Set session timeout on an FBA enabled site

One of the problems SharePoint 2010 when trying to work on Forms Based Authentication (FBA), all the settings in IIS (and web.config) enable sessions of not working. After researching on google, I realized it was a problem in SP 2010. There are many blogs that give code that fixes the problem by correcting the global.asax . I checked and indeed it works, but it does not seem the ultimate solution. Best solution is (for me) working on SharePoint 2010 SP1 . A code of PowerShell . Code: $sts = Get-SPSecurityTokenServiceConfig $sts.LogonTokenCacheExpirationWindow = (New-TimeSpan –minutes 20) $sts.WindowsTokenLifetime = (New-TimeSpan –minutes 20) $sts.FormsTokenLifetime = (New-TimeSpan -minutes 20) $sts.Update() Iisreset You can change the 20 minutes, of course. Hope I helped, Roi

Custom Timer Jobs: func FeatureActivated Access denied

Things worked in the past - do not work more And today issue timer job At MOSS 2007 on the timer job worked, and Today at SharePoint 2010 the timer job runs on owstimer.exe and get an error that the timer job does not work The Error Message: The description for Event ID 0 from source Application can not be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer. If the event originated on another computer, the display information had to be saved with the event. The following information was included with the event: Custom Timer Jobs: func FeatureActivated Access denied . The solution - PowerShell Run this code: $contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService # turn off remote administration security $contentService.RemoteAdministratorAccessDenied = $false # update the web service $contentS...