SharePoint maintenance mode to track webpart issue

As a SharePoint consultant, I often bump into issues with pages in SharePoint OnPrems and Online. To resolve these cases, we – SP consultants – need to deploy our super magic powers (what our clients think we have) 🙂

Most of the page, an error in a page is due to a bug in a webpart raising an exception, sometimes it’s a delegate control but this is another story for another blog post. Here is one magic trick to debug the pages and identify which webpart is running wrong.

SharePoint OnPrems / Classic

Starting from SP 2010, and for next version of OnPrems installation, just add ?contents=1 at the end of the page URL. This will open the page in maintenance mode and display all webparts in this page.

Modern SharePoint

Like a lots of developers I tried the old way and failed … thanks to this Microsoft support article, it gives you the right URL suffix to add to your URLs to enter the web part maintenance mode

In the address line of your browser, append ?maintenancemode=true to the end of the URL for the page. Checkout the Environment property in the mainten

You can find more documentation on these links ➡️ Maintenance mode for client-side web parts | Microsoft Docs and ➡️ Open and use the web part maintenance page (microsoft.com)

Bonus : how to disable SPFx web parts ans extensions

Ayt the end of this nice Microsoft article there is a golden tips ➡️ « If you need to troubleshoot a SharePoint page to see if there is a SharePoint Framework extension or web part causing issues you can append ?disable3PCode=1 to the URL to disable loading of SPFx components » that helped me a lot recently, so I share it to you.

Master piece : all useful SharePoint URLs

You can find every useful SharePoint URLs to save your life every day with SharePoint developement :Useful SharePoint URLs – SharePoint Stuff

SharePoint 2016 project templates missing on Visual Studio 2015

imageWhen you open Visual Studio 2015 (with Update 3) on a SharePoint 2016 developer machine, it may occurs that the SP 2016 templates are missing (it displays only SP 2010 and 2013 templates). In that case, don’t panic ! Just follow the following process :

  1. If you don’t have a version of Office Developer Tools for Visual Studio 2015, download “Microsoft Office Developer Tools Preview 2 for Visual Studio 2015” with the following link : https://www.microsoft.com/en-us/download/details.aspx?id=51683  (don’t go to aka.ms/officedevtoolsforvs2015 , the link is broken)
  2. Install the Microsoft Office Developer Tools Preview 2 for Visual Studio 2015 on your machine
  3. Open Control Panel > Programs > Programs and Features
  4. Uninstall SharePoint Client Components (with the version number 16.0.xxx)
  5. Download the SharePoint Server 2016 Client Components SDK from www.microsoft.com/en-us/download/details.aspx?id=51679
  6. Start developing your successful SharePoint Addins !

Flux de travail SharePoint 2013 non disponible dans SharePoint Designer

Lors de la préparation de quelques démos en vue d’une présentation sur le développement de workflow avec SharePoint 2013, l’installation en standalone a tendance à créer un proxy d’application de service pour workflow non fonctionnel (en général c’est aussi le cas d’autres services…).

Par conséquent, si vous faites un tour dans SharePoint Designer 2013 et que vous essayez de créer un flux de travail, vous n’aurez que le choix du type ‘Flux de travail SharePoint 2010’, la version 2013 n’étant pas disponible :

post_workflow_spd2013 (1)

Il suffit d’aller dans l’administration centrale pour constater du non appareillage du service Workflow Manager avec votre ferme SharePoint 2013 (naviguez dans Gestion des applications > Gérer les services > Workflow Service) :

post_workflow_spd2013 (2)

Pour résoudre ce problème, il suffit de supprimer puis de recréer un proxy du service de Workflow. Néanmoins, si vous essayez de créer ce proxy depuis l’Administration Centrale, vous risquez de tourner en rond assez longtemps car le type de service n’est pas proposé par l’interface :

post_workflow_spd2013 (3)

Voici la procédure pour venir à bout de ce problème :

  1. Dans la fenêtre des services, supprimer le service ‘Workflow Service’
  2. Exécuter la ligne de commande PowerShell suivante dans une console SharePoint 2013 Management Shell : Register-SPWorkflowService –SPSite “http://devcontoso/” –WorkflowHostUri “https://devcontoso:12291″ –AllowOAuthHttp

Note : mon serveur Workflow Manager 1.0 (version Refresh nécessaire si vous êtes sur Windows Server 2012) est hébergé sur le même serveur que SharePoint 2013, j’autorise donc la communication http avec le paramètre –AllowOAuthHttp. Consulter la documentation technet pour d’autres types de topologies et protocoles : http://technet.microsoft.com/en-us/library/jj658588%28v=office.15%29.aspx

Remarque : si vous déjà enregsitré un scope « SharePoint » dans votre serveur Workflow Manager, un message d’erreur s’affiche. Dans ce cas, forcez l’enregistrement avec le paramètre -Force pour écraser l’ancien scope :

post_workflow_spd2013 (4)