Tuesday, October 15, 2013

Sharepoint 2013 Custom Image reditions

While going through this article I found a link to and article on custom image renditions in SharePoint 2013, its certainly useful.

http://blog.mastykarz.nl/responsive-image-renditions-sharepoint-2013/

Windows process explorer

This comes in handy if we need to find out a dlls is being used by which processes. I had to use it when I got an error "cannot access assembly because it is being used by another process" while uninstalling a dll from GAC.

http://social.msdn.microsoft.com/Forums/sharepoint/en-US/356913a7-dda7-41a7-8702-f71ec0a8b7db/cannot-add-assembly-to-gac?forum=sharepointdevelopmentlegacy

The reason for  "cannot access assembly because it is being used by another process" error was that I has added a reference to this dll in a Visual Studio 2012 project and the project was open. The issue was resolved after I close all instances of visual studio

Wednesday, October 9, 2013

Mobile image viewer

SharePoint custom summary links field with rich HTML

http://blog.zebsadiq.com/post/How-to-allow-rich-text-editing-on-summary-link-description-field.aspx
http://msdn.microsoft.com/en-us/library/aa981226%28v=office.12%29.aspx
http://webarj.wordpress.com/2007/05/07/templating-field-controls-in-moss-page-layouts/

http://msdn.microsoft.com/en-us/library/bb861799%28v=office.14%29.aspx

While following steps in the above post I was unable to add using directive for System.Windows.Controls namespace found in PresentationFramework.dll, after searching a little on internet I realized that the dll reference can not be added since I was trying to use 32 bit dll version found in Program Files (x86) directory. Instead when I added dll reference to Program Files\Reference Assemblies\Microsoft\Framework\v3.0\PresentationFramework.dll, the namespace was available.

The sharepoint software factory also has precipices to add custom fields although not one for custom summary links field
http://spsf.codeplex.com/

after installing it I was getting an error "The package SPAM.SPSF could not be activated, the template cannot be unfolded", the reason was I did not activate the SPSF extention as explained here
http://msdn.microsoft.com/en-us/library/ff697223.aspx

Field Definitions
http://msdn.microsoft.com/en-us/library/aa979575.aspx

Finally I used below steps to create a simple field which only saves URL to a custom list
http://bernado-nguyen-hoan.com/2011/11/07/walkthrough-custom-field-type-for-uploading-and-displaying-images-in-sharepoint-2010-lists/

And then added that lists default view webpart to the "View Rendering Template" and "Diplay Rendering Template". The steps to create a list view webpart programmatically are explained in below post,

http://stackoverflow.com/questions/1588019/programmatically-insert-a-list-as-a-webpart-in-a-webpart-page-in-wss-3-0


However I did not use any webpart zone in my control and simply added the webpart to the base.TemplateContainer.Controls collection.

http://msdn.microsoft.com/en-us/library/office/ms543215(v=office.14).aspx

Tuesday, October 1, 2013

Deleting orphaned content type

If deleting an orphaned content type gives the error "SPException: The content type "XYZ" is part of an application feature.", we need to change "IsFromFeature" flag in content database for the particular content type from "1" to "0" as explained in these posts:

http://sharepoint.stackexchange.com/questions/11114/how-to-delete-a-content-type-part-of-an-application-feature

http://apichot.blogspot.co.uk/2009/11/how-to-delete-orphan-content-type.html?_sm_au_=iVVW6SjD4nF5Jrt6

and then  delete the content type either manually or using code as explained here:

http://msdn.microsoft.com/en-us/library/ms453791.aspx

If you get an error "Content Type is still in use<nativehr>0x800710d3</nativehr><nativestack></nativestack>" follow below instructions
http://www.mysharepointadventures.com/2011/06/content-type-is-still-in-use-woes/

There are some times broken link as explained in below post, but this method is too risky to try and not supported by microsoft. I have just mentioned it here for a reference, but I would not recommend it.
http://mqsharepoint.blogspot.co.uk/2009/01/content-type-is-still-in-use.html?_sm_au_=iVVtTJsssQkjV8tM 

c# httpclient The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch

 If we get this error while trying to get http reponse using HttpClient object, it could mean that certificate validation fails for the remo...