If you have enabled ShortPoint Preloader on your Record Center site of your SharePoint Sever 2013 or SharePoint Server 2016 environment and you are facing any of following errors when you try to access Manage Records Center (as shown in below image) page then this article is for you!
Error you are facing
Sorry, something went wrong An error occurred during the processing of /RC/rcconsole.aspx. Code blocks are not allowed in this file.
The base type 'Microsoft.Office.Server.Search.Internal.UI.SearchResultsLayoutPage' is not allowed for this page. The type Microsoft.Office.Server.Search.Internal.UI.SearchResultsLayoutPage, Microsoft.Office.Server.Search, Version=220.127.116.11, Culture=neutral, PublicKeyToken=71e9bce111e9429c could not be found or it is not registered as safe.
Note: the assembly detail or page URL in error might differ as per your configuration and platform.
By default SharePoint does not allow inline codes (The one which we use for ShortPoint Pre-loader) and it throws above error when accessing the secure pages. You will see this error when there is a missing safe control entry in the web.config file, located at Inetpub\Wwwroot\WSS\VirtualDirectories\<port number of your web-application>
Backup and Precaution
We are going to make few changes in Web.config file of the Web Application which contains your Record Center site collection or subsite. The very first step is the take backup of your Web.config. Here are steps you can follow to navigate to your web application's Web.config and backup
Please be aware that the steps below requires IISReset (resetting your internet information service) which means your all sites will go down for couple of seconds or more (If you did any mistake in Web.config entry). So we highly recommend to perform these steps during non pick hours to avoid downtown.
Step 1: Add PageParserPath entry
This step is to Inform your SharePoint Server to not block code on any of the pages under the given web application.
- Open your web application's web.config file with any code or text editor (we are using Notepad++ in this example).
- Navigate to configuration -> SharePoint -> SafeMode -> PageParserPaths (if this does not exist, please create it) and add following entry inside PageParserPaths element;
<PageParserPath VirtualPath="/*" CompilationMode="Always" AllowServerSideScript="True" IncludeSubFolders="true" />
Step 2: Register SharePoint search SafeControl
As soon as you will add above entry, your Search page will start giving error. To fix it, please add following entry to your
Note: Please ensure that entry is not already exist to avoid duplicate entries and errors.
Please save your file.
Step 3: IIS RESET
finally, its time to reset IIS. Please open command prompt as administrator
If you are experiencing any issue further to this or your problem still exist, please feel free to contact us.
- This solution is only for SharePoint On-premise environment, it doesn't work for SharePoint Online.
- Above solution is applicable to both Record Center site collection or sub-site