Posts

SharePoint 2010 - Document Library (checked out documents not visible to anyone)

Issue  When trying to remove folders in a document library, it appears that no files exist in the folder, yet you receive an error saying the files have not been checked in. Workaround Go to the Document Library Settings, select Manage files which have no checked in version, then select Take Ownership of Selection. This will allow you to check in the files that were missing, and remove that folder.

SharePoint 2010 / jQuery - Swapping Images

Web part uploaded and forgot to include the image in the feature? This could be a potential issue on a managed SharePoint 2010 environment (Office 365 - Dedicated, etc.). The reference points to a path in the _layouts folder. How can I temporarily resolve this issue until I update the project? Simple. Modify the master page or add a content editor web part with the following jQuery, and store the image into a location that is easily accessible. jQuery(function() { jQuery('img[src="/_layouts/images/old-image.png"]') .attr("src", "/subsite/PublishingImages/new-image.gif"); });

SharePoint 2010 - Changing User Sessions

Ever get into a situation where you need to use a test user account to log in and test something? Generally, you will use the "Log in as different user" option and can not change back without terminating the entire user session and close out your entire browser. At any time, you can log in with whatever user account by manually entering the following, enter your domain and subsites and then "/_layouts/accessdenied.aspx?loginasanotheruser=true​". For example, "http://www.yourdomain.com/subsite/_layouts/accessdenied.aspx?loginasanotheruser=true".

SharePoint 2010 / Debug - Locating Active SharePoint Process (W3WP.exe)

Often times you may be looking at debugging SharePoint custom code and need to attach the debugger to a process. The process list may list several instances of W3WP.exe. To locate which instance you are particularly using, you can go to the command prompt and run "%systemroot%\system32\inetsrv\appcmd list wps". The following cmdlet loops to allow me to quickly refresh the net services list, which is useful after an IIS reset. :loop cls %systemroot%\system32\inetsrv\appcmd list wps pause goto loop

SharePoint 2010 - This item is no longer available.

Issue: On some library views when you drop down the edit control block (ECB) you will see the following error. This item is no longer available. It may have been deleted by another user. Click 'OK' to refresh the page. To resolve this issue it is necessary to re-create the library view. Workaround: On the library with the view issue, go to "Library Settings" and scroll to the bottom of the page. Click on "Create View," choose to start the view from an existing view, be sure to select "Make this the default view." Choose to create the new view from the view that is having the issue. (e.g. Versions). When creating your new library view, choose any name you please. If you are replacing the default view, be sure to select "Make this the default view." Be sure to make it a public view and keep all other settings to duplicate the other view, and click "OK".

SharePoint 2010 / MSOCAF - Use the Anti-XSS library to properly encode the data before rendering it

If you have the following error: Use the Anti-XSS library to properly encode the data before rendering it You will need to visit the Microsoft Download Center and download and install, at least, AntiXSS Library v4.2, from http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=28589 . In your solution, you will need to add the reference, for AntiXSSLibrary, located wherever it was installed, in my system, at "C:\Program Files (x86)\Microsoft Information Security\AntiXSS Library v4.2\NET35\AntiXSSLibrary.dll". using Microsoft.Security.Application; // AntiXSS.HtmlEncode, has been recently deprecated. string strProperty = Encoder.HtmlEncode(Request["Property"]);

SharePoint 2010 - MSOCAF Prep Script

When operating on a hosted or Office 365 Dedicated (including BPOS-D) environment, you will need to utilize MSOCAF to both validate your code, do a test deployment, and submit to Microsoft. With the following cmdlet, you’ll need to set two environmental variables, CAF_ANALYSIS_ROOT_PATH, CAF_SHORTCUT_PATH. Basically, this MSOCAF cmdlet, allows you to simplify the process of testing individual solutions during your development cycle. This cmdlet will copy the files to the necessary location and launch MSOCAF directly. @echo off SET WSP=SolutionName.wsp SET PDB=SolutionName.pdb SET CAF_ANALYSIS_ROOT_PATH=%CAF_ANALYSIS_ROOT_PATH% SET CAF_SHORTCUT_PATH=%CAF_SHORTCUT_PATH% @echo on @echo. cls @echo. @echo Clearing Solutions artifacts folder… rmdir /s /q %CAF_ANALYSIS_ROOT_PATH%”\Caf Reports” rmdir /s /q %CAF_ANALYSIS_ROOT_PATH%”\Solutions artifacts\” md %CAF_ANALYSIS_ROOT_PATH%”\Solutions artifacts\” REM del /q %CAF_ANALYSIS_ROOT_PATH%”\Solutions artifacts\*.*” @echo. @echo Copying fil...