SharePoint online: Error ‘Updates are currently disallowed on GET requests. To allow updates on a GET, set the ‘AllowUnsafeUpdates’ property on SPWeb’ while creating new app catalog site

July 6, 2020 2 comments

Recently I have created new E5 personal tenant for my development and testing purpose. I wanted to deploy and test the SPFx component in that tenant, hence I tried to create the App catalog.

I directly went to SharePoint admin center in Office 365 and tried to create new App catalog site, like following.

App catalog Creation

App catalog Creation

I got the error ‘Updates are currently disallowed on GET requests. To allow updates on a GET, set the ‘AllowUnsafeUpdates’ property on SPWeb’.

App catalog Creation Error

App catalog Creation Error

I initially thought that the error is due to some technical glitch and no clear reason of the error explained in error and hence I tried to create App catalog site couple of times more but no luck and got the same error.

The solution is bit weird as I just created new tenant, I do not have any site created yet and I jumped directly to create app catalog site.

Then I have created one test site in tenant.

One Site Created

One Site Created

And it worked, I again tried creating the App catalog site and it worked.

App Catalog Success

App Catalog Success

So we need to at least create one site before creating App catalog. The only concern is Microsoft should provide some meaningful error message so that we will not be confused.

Sharing is caring, stay safe. Take care.

Visual studio load test giving error- Request failed: The request was aborted: Could not create SSL/TLS secure channel

November 29, 2019 Leave a comment

Recently I ran the load tests in visual studio, I got errors “Request failed: The request was aborted: Could not create SSL/TLS secure channel”. Those load tests are working fine previously but suddenly stopped working. After investigation I found that recently our production server had some changes in TLS protocol support and now TLS 1.2 support added.

Request failed: The request was aborted: Could not create SSL/TLS secure channel.

Request failed: The request was aborted: Could not create SSL/TLS secure channel.

So, the cause found is recent change done on server but now finding the solution to resolve this issue and run the load test in visual studio.


We need to create Web Performance Test Plug-In to resolve this issue.

  1. Open a Web performance and load test project that contains a Web load test.
  2. In Solution Explorer, right-click on the solution and select Add and then choose New Project.The Add New Project dialog box is displayed.
  3. Under Installed Templates, select Visual C#.
  4. In the list of templates, select Class Library.
  5. In the Name text box, type a name for your class. Choose OK.
    Visual studio add new class library project
    Visual studio add new class library project
  6. The new class library project is added to Solution Explorer and the new class appears in the Code Editor.
  7. In Solution Explorer, right-click the References folder in the new class library and select Add Reference.
  8. The Add Reference dialog box is displayed.
  9. Choose the .NET tab, scroll down, and select Microsoft.VisualStudio.QualityTools.WebTestFramework. Choose OK.
  10. The reference to Microsoft.VisualStudio.QualityTools.WebTestFramework is added to the Reference folder in Solution Explorer.
    Visual studio add reference
    Visual studio add reference
  11. In Solution Explorer, right-click on the top node of the Web performance and load test project that contains the load test to which you want to add the Web performance test plug-in and select Add Reference.
  12. The Add Reference dialog box is displayed. Choose the Projects tab and select the Class Library Project. Choose OK.
    Visual studio add plugin project reference
    Visual studio add plugin project reference
  13. In the Code Editor, write the code of your plug-in. First, create a new public class that derives from WebTestPlugin.
  14. Implement code inside one or more of the event handlers.
  15.          public class Tls12ForcedPlugin : WebTestPlugin
            [Description("Enable or Disable the plugin functionality")]
            public bool Enabled { get; set; }
            public override void PreWebTest(object sender, PreWebTestEventArgs e)
                base.PreWebTest(sender, e);
                // We're using SSL2 here and not TLS. Without this line, nothing works.
                ServicePointManager.SecurityProtocol = (SecurityProtocolType)(0xc00);// SecurityProtocolType.Ssl2;
                //we wire up the callback so we can override  behavior and force it to accept the cert
                ServicePointManager.ServerCertificateValidationCallback = RemoteCertificateValidationCB;
                //let them know we made changes to the service point manager
                e.WebTest.AddCommentToResult(this.ToString() + " PP has made the following modification-> ServicePointManager.SecurityProtocol set to use SSLv3 in WebTest Plugin.");
            public static bool RemoteCertificateValidationCB(Object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
                //If it is really important, validate the certificate issuer here.
                //this will accept any certificate
                return true;
  16. If you are using Framework 4.0 then you may get error SecurityProtocolType.Ssl2 not found.For other Framework –

    SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12

    For Framework 4.0

    (SecurityProtocolType)(0xc0 | 0x300 | 0xc00)

  17. After you have written the code, build the new project.
  18. Open a Web performance test. To add the Web performance test plug-in, choose Add Web Test Plug-in on the toolbar.
  19. The Add Web Test Plug-in dialog box is displayed. Under Select a plug-in, select your Web performance test plug-in class.
  20. Visual studio plugin project displayed

    Visual studio plugin project displayed

  21. In the Properties for selected plug-in pane, set the initial values for the plug-in to use at run time. Choose OK.
    Visual studio error resolved
    Visual studio error resolved

Step by step installation of SharePoint Server 2019 preview for single server farm topology

Hi Friends,

As we know that SharePoint Server 2019 and Project Server 2019 preview available, I was excited with this news and thought to have it installed on and check what’s now.
Following article will have instructions to install SharePoint Server 2019 preview on Azure VM.
Let’s start by creating the virtual machine on Windows Azure platform.
I have created a VM with image template ‘SQL Server 2017 Standard on Windows Server 2016’.

SP2019_Azure VM Image

I have chosen ‘Standard B4Ms’ sizes configuration.

SP2019_Azure VM

And created the VM, it have taken some time to get it created. Following are the configuration shown on the created VM on Azure.

Now as we have Virtual machine ready with SQL server 2017, we can start with SharePoint Server 2019 installation.
1. Let’s first download the setup from
2. I have chosen ‘en-us\16.0.10711.37301_OfficeServer_none_ship_x64_en-us_dvd\officeserver_en-us.img’ installation language for downloading installation, its 3.8GB size.

Download SharePoint Server

3. Click Save to copy the disc image file to your computer.
4. Right click on the ‘officeserver_en-us.img’ file and select Mount option.


5. Navigate to the mounted drive.
6. Run splash.hta to launch the SharePoint Server 2019 Start page.
7. Click Install software prerequisites to launch the Microsoft SharePoint 2019 Products Preparation Tool.


8. Follow the instructions in the tool to complete the installation of the software prerequisites.


9. Select ‘Finish’ to restart the server and complete the installation of prerequisites.
10. After restart if the image file not mounted automatically then repeat step 4,5 and 6 to run the splash.hta file.
11. On the SharePoint Server 2019 Start page, click ‘Install SharePoint Server’ to launch Microsoft SharePoint Server 2019 Public Preview Setup.


12. When prompted, provide a product key. You can use the trial product key from article install instructions section. The trial period is 180 days. You can convert to a licensed installation at any time during the trial or after the trial has expired by entering the appropriate product key in Central Administration.


13. Sit back and relax to complete the installation.



14. After completing the setup SharePoint Product configuration wizard will be started.


15. Select ‘Yes’ at the following screen.


16. As we are creating new farm, select as below screen shot.


17. Select Next on below screen.


18. In next screen we need to provide DB server details and Database access account details.


19. After giving user details using which we have created the VM,I was getting following error “The specified user is a local account. Local accounts should only be used in stand alone mode.


20. I thought we need to create a SQL user and pass that to continue the setup.
21. Hence I connected to SQL server management studio.


22. I have created a new SQL user.


23. And granted all the roles to that account.


24. Now selected the newly created user also not helping me and giving same error as given in step no 19.
25. After that I have tried creating the new local user account and added that to Local administrator group and using those user in SQL. This also not helped me and I got stuck for some time.
26. After searching for the error we came across SP 2016 post when the solution was described to use the New-SPConfigurationDatabase cmdlet.


New-SPConfigurationDatabase -DatabaseName SharePoint_ConfigDB -DatabaseServer [ServerName] -AdministrationContentDatabaseName SharePoint_ContentDB -Passphrase (ConvertTo-SecureString [password] -AsPlaintext -Force) -FarmCredentials (Get-Credential) -localserverrole SingleServerFarm

27. Please read about at cmdlet New-SPConfigurationDatabase , I used ‘SingleServerFarm’ option for localserverrole parameter as I am installing on single server.
28. This command will take some time and create configuration database.
29. After successful completion run the SharePoint product configuration wizard again.


30. This time it got succeed and we are able to proceed.


31. Click Next to continue with configuration. And wizard will continue as following.



32. Now the final configuration task started and installation continued.


33. Installation success message shown as following.


34. Now we can able to access SharePoint central administration.


We can now free to create web application and site collection. Modern site templates are available at ‘Template selection’ step.

Hope this article will help to save some valuable time while setting up SharePoint 2019 preview.
Thanks for Reading.

SharePoint online / SharePoint 2013: Sharing variable values between search control and display templates

November 29, 2017 Leave a comment

Recently I came across to a scenario where I need to set the variable in control template and the value of the variable should be accessible in item template and vice versa.
I was showing some data in item templates and using third party pagination for displaying the search result, needed the value of pagination size which is available in control template.
I tried with normal JavaScript variable but due to the scoping in display template it was not available for me inside the item template.
Solution 1:
We can use Windows.variable which is nothing but global variable creation on the scope of the window object and hence will be accessible throughout the scope of windows object.
Control Template:

<!--#_ window.PageSize = "30"; _#-->

Item Template:

<!--#_ alert(window.PageSize); _#-->

Solution 2:
Another better alternative is to use the built-in ctx object which is already shared between the control and item display template.
Control Template:

<!--#_ ctx.PageSize = "30"; _#-->

Item Template:

<!--#_ alert(ctx.PageSize); _#-->

Happy learning.

SharePoint 2013: Creating and calling custom JavaScript function in search display template

October 23, 2017 Leave a comment

Hi Friends,

Recently I came across a requirement where I need to create a custom JavaScript function which will change the date formatting on the provided string date parameter.

I tried creating normal JavaScript function in display template and tried calling it from other part of template but the function was undefined and not found inside the display template, I got little bit confused as I have created the JavaScript function in same display template but still not able to find it in same display template while calling. We can have couple of ways to resolve the issue.

Solution 1:

After some googling I found the cause of the issue and the solution as well, as follows.

The possible reason is scoping of the display template not allowing to consider external JavaScript function as a part of the scope to call inside display template.

The solution is to create new function on window scope and the call it in the desired place inside display template.

window.MyTestFunction = function(myParam)
// your own logic to work on the param 'myParam'

Calling the function:

<a style="cursor:pointer" onclick='window.MyTestFunction(3)'>Call My custom JS function</a>

Solution 2:

  1. Create a JavaScript file (MySampleJS.js) in the Display Templates/Search folder.
  2. Add the custom JS function in to the MySampleJS.js file.
  3. Add the following code into thetag below to include the JS file in display template
$includeScript(this.url, "~sitecollection/_catalogs/masterpage/Display Templates/Search/ MySampleJS.js");

Happy learning.

SharePoint 2013: Converting GMT/UTC time to local time in XSLT for rendering RSS feed

September 28, 2017 Leave a comment

Hi Friends,

Recently I came across the requirement where the date coming from RSS feed which is in GMT format needed to be converted to local time and display in required format.

As RSSAggregatorWebPart webparts executes on server side and renders the output html in browser, we cannot utilize the rss date to convert to local date.

I tried multiple solution with default XSLT for calling JavaScript function, like CDATA, xsl:comment and try adding script tag but none worked for me.

Finally after struggling I found a way to achieve desired result using onerror handler with img tag.

Solution as fallows –

XSLT changes

Add following section in XSLT, which actually uses the img tag to call the JavaScript function using on error event.


JavaScript changes

Following function we needed to add a separate JS file which will be referred in the master page or add in master page itself and make sure it that JS method gets loaded before the method call in XSLT.

function ConverDateToLocal(pDate, sender) {
    try {
        var today = new Date(pDate);
        var dd = today.getDate();
        var mm = today.getMonth() + 1; //January is 0!
        var yyyy = today.getFullYear();
        var hh = today.getHours();
        var mmm = today.getMinutes();
        /*if(dd<10) {

        if(mm<10) {
        } */
        var restStr = dd + '.' + mm + '.' + yyyy + " " + hh + ":" + mmm;
        if (sender != null) {
        var senderid =;
        if (senderid) {
        var senderidsplit = senderid.split('_');
        if (senderidsplit.length > 0) {
                    var datedivid = "datediv_" + senderidsplit[1];
                    if (datedivid) {
                        var datediv = document.getElementById(datedivid);
                        if (datediv != null) {
                            datediv.innerHTML += " :: " + "New ::" + restStr;
			                // After testing folling code should be execuated
			                //datediv.innerHTML = restStr;
    catch(err) {}

After applying the XSLT we can see the output like following where first date is GST date and next date is converted local date.


Happy coding.

SharePoint: How to check if page is in edit mode or not in JavaScript

August 28, 2017 Leave a comment

As SharePoint evolved and other client technologies started to become popular and independent we are achieving most of the solution with client side technologies like JavaScript, jQuery and other similar.

I came across one requirement while working on a JavaScript based component, where I need a conditional code to run only when my page is in edit mode. I found multiple solutions which I summaries below.

Option 1:

var inDesignMode = document.forms[MSOWebPartPageFormName].MSOLayout_InDesignMode.value;
if (inDesignMode == "1")
// page is in edit mode
// page is in browse mode

For Wiki pages

var wikiInEditMode = document.forms[MSOWebPartPageFormName]._wikiPageMode.value;
if (wikiInEditMode == "Edit")
// wiki page is in edit mode
// wiki page is not in edit mode

Option 2: Using SP.Ribbon.PageState.Handlers.isInEditMode()

var InEditMode = SP.Ribbon.PageState.Handlers.isInEditMode();
// page is in edit mode
}, 'SP.Ribbon.js');

Option 3: While checking the value in SharePoint search display template we need to use Srch.U.isPageInEditMode Method

var isRollupPageInDisplayMode = Srch.ContentBySearch.isRollupPage(ctx.ClientControl) && !Srch.U.isPageInEditMode();

Happy Learning!

SharePoint 2013: Newly created rendition not working

Recently I was facing an issue with newly created rendition, I created new rendition but the images are not showing the newly created rendition on my development server, also in image picker we not able to see the newly created rendition.

After waiting for some time as well my newly created rendition not worked. After some investigation we figured out that as renditions was previously working fine means blob cache working as expected but after adding new rendition we found that it was not working.


We need to flush the blob cache using PowerShell.

$webApplication = Get-SPWebApplication "";

After flushing the blob cache we are now able to see newly added rendition. For more details please check

Flush action will not be immediate, it will be queued.

Hope this will help, happy learning.