Posts

Showing posts with the label 2010

SharePoint - Moving Sites and Subsites into another Site

If there is a need to move sites and subsites into another site within the same web application, this can be easily performed using the "Site Manager". Often times, this option is over-looked, in favor of site templates, or other backup and restore operations. However, this is the simplest option available. Note: This site is available on "SharePoint Online or Office 365 Dedicated" as well as any stand-alone SharePoint installation, on the basis that you activate the Publishing Features within SharePoint. If you visit "http://enter_your_site_url/_layouts/sitemanager.aspx", you'll see the Site Manager, where you can do a move operation of all pages and sub-sites. Select the parent site of the sub-site you want to move in the left navigation pane. Check the box next to the sub-site you want to move in the right pane. Click the Actions drop-down and click Move . Select Destination of the sub-site selected in the next dialog. SharePoint Sta...

SharePoint - Feature with ID already exists - Force Option

Occasionally, when deploying SharePoint Solutions (WSP) directly from Visual Studio, you will receive the following error. Error occurred in deployment step 'Add Solution': A feature with ID {Guid} has already been installed in this farm. Use the force attribute to explicitly re-install the feature. This error occurs when you have a previously defined feature installed, as part of the same solution, which will trigger the error. To overcome this issue, you can open the feature (double-click) which is part of your actual project, and you will see the properties window come into focus. In this window, you will see details, such as title, description, scope, items in the feature. In the property window, you'll see an option titled 'Always Force Install'. By default, this item is set to "false". If you set this option to "true", it will over-write the feature each time the project is installed. SharePoint Stack Exchange

SharePoint - An unexpected error has occurred. (Web Part Page Maintenance)

Image
On occasion, a web part may be causing your SharePoint pages to throw an unexpected error. An unexpected error has occurred. Web Parts Maintenance Page: If you have permission, you can use this page to temporarily close Web Parts or remove personal settings. For more information, contact your site administrator. Troubleshoot issues with Microsoft SharePoint Foundation. In addition to leveraging the ULS Logs , to investigate the Correlation ID, you can append " ?contents=1 " to your page URL. This will allow you to close web parts, restore defaults to web parts, or delete web parts from your page.

SharePoint – The current operation could not be completed. Try again, or contact your system administrator.

If attempting to utilize Site Manager, to COPY an entire site or any particular pages, and receive the following error. The current operation could not be completed. Try again, or contact your system administrator. You may re-try the operation, and you may need to clean up the half-created data first before re-trying. If the problem persists, please contact your system administrator. If you review the logs, and the following is displayed, System.ArgumentException (0×80070057) Microsoft.SharePoint.Library.SPRequestInternalClass.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder) at Microsoft.SharePoint.Library.SPRequest.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder) at Microsoft.SharePoint.SPWeb.GetFileOrFolderObject(String strUrl) at Microsoft.SharePoint.Publishing.CommonUtilities.GetFile...

SharePoint – Web Service Requests in InfoPath Forms (Classic to Claims)

Image
Without writing code, you can populate User Profile Service (UPS) information into your fields in InfoPath forms. This process is clearly defined in the following  blog . However, as this works perfectly, in the classic-based authentication there are several modifications that will need to be made, to fully utilize the forms, as a result of product limitations caused by Claims-based authentication. Firstly, a Secure Store ID will need to be created in Central Administration (Manage Service Applications), you’ll need to assign the Target Application ID, and add the Target Application Administrators which would ideally need to be a generic ID that never expires, and the members that are mapped to the credentials defined. You’d need to then set the credentials on that domain account for the secure store target application. Lastly, under Central Administration (General Application Settings), and InfoPath Forms Services, the option to ‘Allow user form templates to use authentication ...

SharePoint 2010 - Remove / Disable Themes

If you've ever encountered the need the disable themes on a site collection, there are a few options you may have available. Firstly, there are policies in Central Administration to remove the ability to change the themes across the entire web application, which can be done by the following: Visit Central Administration > Application Management > Web Applications > Manage Web Applications. Select the Web Application that you want to restrict the themes on. Click on "Permission Policy Level" on the Ribbon. Name the policy, and find the permission "Apply Themes and Borders" and toggle the "Deny" check box. Click save. Click on "User Policy" on the Ribbon. Add the users and groups you want to restrict, and then apply the policy you just created. Alternatively, if you want to manually remove the themes, you can update the theme entries, in a file called: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\...

SharePoint 2010 - Cannot access the local farm.

Issue: If you're encountering the following error, when trying to run a powershell script, you may not have sufficient permissions on the database. Get-SPWeb : Cannot access the local farm. Verify that the local farm is properly configured, currently available, and that you have the appropriate permission to access the database before trying again. The issue can be remedied with a few quick powershell commands. Workaround: Perform the following script in the SharePoint Management Shell, as a farm administrator and it will remove the error. Get-SPDatabase | Add-SPShellAdmin SomeDomain\SomeUserName This will grant the user both access to the configuration database as well as the content database. Alternatively, you can revoke that granted access with the opposite command. Get-SPDatabase | Remove-SPShellAdmin SomeDomain\SomeUserName

SharePoint 2010 - MySite Redirection

When user's click a user's name in a document library, etc, a file userdisp.aspx controls where the user is directed. Assuming you want to have all user links bring users to My Sites, you can start off creating the user control, by the following code on http://blogs.sharepointguys.com/brendon/sharepoint-2007/programming/redirect-to-your-own-mysite-landing-page/ and then in the RedirectIfNecessary(SPListItem user) you can utilize the following code. if (Request.QueryString["id"] != null) { SPSite _site = SPContext.Current.Site; SPServiceContext _serviceContext = SPServiceContext.GetContext(_site); UserProfileManager _userProfileManager = new UserProfileManager(_serviceContext); string _mySiteUrl = _userProfileManager.MySiteHostUrl; string _profileUrl = string.Empty; int userID = 0; if (int.TryParse(Request.QueryString["id"].ToString(), out userID)) { SPUser profileUser = SPContext.Current.Web.SiteUsers.Get...

SharePoint 2010 - Current Variation / Variation Labels

If you're trying to develop a web part, which utilizes the variation title and doing so by accessing the variation labels lists in SharePoint 2010 and experiencing problems, give this function a try. I've written it to compare the accessible locales against that of the current web LCID. public static string GetCurrentWebRegionLabel() { string strLabel = "USEN"; SPSecurity.RunWithElevatedPrivileges( delegate() { ReadOnlyCollection _variations = Variations.Current.UserAccessibleLabels; strLabel = _variations.FirstOrDefault(m => m.Locale.Equals(SPContext.Current.Web.Locale.LCID.ToString())) .Title.ToString(); }); return strLabel; }

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 / 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 - Disposable type not disposed Microsoft.SharePoint.SPWeb

If you ever get the following warning through the MSOCAF Wizard, Disposable type not disposed Microsoft.SharePoint.SPWeb modify the the following contents: using (SPSite _SPSite = properties.Feature.Parent as SPSite) { using (SPWeb _SPWeb = _SPSite.RootWeb) { ... } } to the following: using (SPSite _SPSite = properties.Feature.Parent as SPSite) { SPWeb _SPWeb = _SPSite.RootWeb; ... } as no explicit rootweb dispose is required. Alternatively, you could also do, SPWeb _SPWeb = SPContext.Current.Site.RootWeb;

NewsGator / SharePoint 2010 - Error Accessing Farm

When attempting to install NewsGator into a SharePoint 2010 Farm Environment, you may encounter the following error, when the installer checks the SharePoint version: Unable to access the farm. To resolve the error, make sure your account is logged into an account that has access to the SharePoint Farm SQL instance, as well as, a SharePoint Farm Administrator role.

Converting VS 2010 Solution to VS 2008

If you ever need to convert a Visual Studio 2010 Solution to a Visual Studio 2008 Solution, you know there is no native conversion support. When helping someone on the codeguru forums , I found this code project solution, to help them, and thought I should share it with everyone. Please check out the solution here . Enjoy.