Skip to main content

Posts

Showing posts with the label SharePoint Trick

Log4Net Custom Logger for SharePoint 2010 and 2013 (With Attached working Code)

What is the Problem The big problem in SharePoint 2010/2013 to write the custom error to log files, whenever the error comes, the developer grab the associate correlation GUID and see the associated error in 14 hive folder. The log file also contains the bunch of other information as well. It would be great if somehow I can develop the custom logging feature for our project that is only specific to my project. It will reduced my effort and it would be a big win for me as a developer. Solution we would able to solve this problem by using 3rd party open source DLL “log4net” . We have written some custom classes to override the base function that would help us to write SharePoint logs into the 14 hive. These classes contain the logic for generating the logs under the same location, where the SharePoint logs are generated i.e 14 hives under different folder (This will help to get the exact information during the error and trace). Solution Dependency Log4Net Dll Important C...

CryptographicException : Keyset does not exist (issue fixed)

One of our project(SharePoint) requirements, we need to use the certificate to encrypt and decrypt the data by using the public and private key. So the code implemented on the DEV working fine, but issue comes when code deployed on the other servers. The error was “ Keyset does not exist ”. The base exception class of this error is “ CryptographicException ”. CryptographicException : Keyset does not exist 0(issue fixed) RSACryptoServiceProvider rsaEncryptor = ( RSACryptoServiceProvider )certificate.PrivateKey; This exception comes when the application pool account doesn’t have access to read the certificate private key. For this we would required to give the full access to the particular certificate. Followings are the required steps to fixing this issue. Solution Application Pool account doesn’t having an permission to access the private key value Steps 1.   Login to server Press Ctrl+R type to   MMC. 2.   File -> Add or remov...

TechEd OSP309 Session bugs and fixes (CRM Connector bdcm)

I am working on the Enterprise Search so recently I got the requirement that I need to crawl the data from the CRM 2011. So for that I need to create the BDCM file. I goggled it and finally got the post on the MSDN “ Source Code from my TechEd OSP309 Session ” and start working on it. I did all the steps then I got the nasty error. Tried to degug the code the inner exception was “Error: An unsecured or incorrectly secured fault was received from the other party”. “An unsecured or incorrectly secured fault was received from the other party”.  To solve the error I did the following steps.  Download the latest CRM SDK from the MSDN.  Add the latest Reference of the following  microsoft.xrm.sdk.dll microsoft.crm.sdk.proxy.dll Change the code of the function “Util_CreateOrganizationService” having a file name EntityServices.cs (At the end of this post you will find the updated code). Project name”CRMEntityService”. Rebuild the code and redeploy the ...

SharePoint 2010 Calendar: Remove Custom Commands tab and Add new export event button in view tab

To achieve this functionality we have to first hide the custom commands tab from event list. Open Visual Studio.  Create SharePoint Empty project. Add UserControl give it name CalendarFeature. Include dll in your project from Path : C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\Microsoft.Web.CommandUI.dll Write the following lines of codes in ascx file. protected   void  Page_Load( object  sender,  EventArgs  e)         {              SPRibbon  ribbon =  SPRibbon .GetCurrent( this .Page);              if  (ribbon !=  null )             {                 ribbon.TrimById( "Ribbon.CustomCommand...

SharePoint 2010 Hide Ribbon button using CSS

Steps Use any Element inspector to find the id of the ribbon button.  Use “\” backslash to escape period “.”  Apply class in master page.  Example Before List Item Ribbon To Hide New List Item #Ribbon\.ListItem\.New\.NewListItem-Large{Display:none;} To hide New item group.  #Ribbon\.ListItem\.New.ms-cui-group{display:none;} To hide Delete button  #Ribbon\.ListItem\.Manage-LargeMedium-1-2{Display:none;} To Hide List Manage Group #Ribbon\.ListItem\.Manage { display:none; }