Pages

Tuesday, February 23, 2016

Facebook template is not found in Visual Studio 2015

Problem Background

Today I thought of creating a Facebook app using Facebook template which was available in Visual Studio 2013. Shockingly the template was not available once I select ASP.Net Web Application template and click OK (Screen shot attached).

1

Solution

Then I got to know by searching online that there is a new extension has been released for ASP.Net project templates.

Check out the below link and install the Visual Studio 2015 Extension for ASP.NET Project Templates.

https://blogs.msdn.microsoft.com/webdev/2015/02/08/introducing-the-visual-studio-2015-extension-for-asp-net-project-templates/

PS: I directly downloaded the extension from the below url and installed it.

https://visualstudiogallery.msdn.microsoft.com/9402d38e-2a85-434e-8d6a-8fc075068a42

2

Thursday, February 11, 2016

Sri Lanka SharePoint Forum - Monthly gathering (January)

Joel Oleson and Michael Noel were our special speakers for Sri Lanka SharePoint Forum Monthly gathering for the month of January. 

12510357_10153659913422530_2219245561543803648_n


We would like to thank the speakers, attendees and all the sponsors.

I’m also privileged to receive Microsoft Devices from Totalamber as gift for the meetup. 

12716084_997338653674303_825077823129639774_o


Couple of photos from the day.


12522950_10153667635812530_7712577680192952576_n12540786_10153667635747530_1889572300362793346_n

12508989_10208103433524695_5401919268181960161_n

Wednesday, January 20, 2016

Enable CORS for web API 2 through Azure portal

Introduction

We can enable Cross-Origin Request (CORS) by adding “Microsoft ASP.Net Cross Origin Support” nuget package. Also we can enable CORS thorough Azure portal if we have deployed our web API 2 in azure as a app service.

Enable CORS for web API 2 through Azure portal
  1. Login to your azure portal through a browser
  2. Go to app services and click on you app service where web api 2 is hosted.
  3. Go to setting page and scroll thorough
  4. You will find API section and under that you will find CORS (I have highlighted in yellow)

cors1

  1. Click on CORS and you can add one or more your client apps. Also you can * mark to grant access to all client applications.
cors2

Tuesday, January 19, 2016

Cannot open server “” requested by the login. Client with IP address “” is not allowed to access the server issue in Azure SQL Database

Problem

I created a windows forms application in my local machine and the database was deployed in Azure. Once I try to access the database from my local machine through the application I got the exception “Cannot open server “” requested by the login. Client with IP address “” is not allowed to access the server issue”. See the screenshot.
1

Solution

Step 1. Login to Azure portal and select your database. I have used the new Azure Portal.
Step 2. Select tools on from top menu.
image
Step 3. Once you select Tools the window will be expanded and will show “Open in Visual Studio”. Select it.
image
Step 4. Then click on Configure your firewall.
image
Step 5. Give any rule name and you can give your IP address range. Note that the Client IP address is your own IP address. You can set the rage using the client IP address shown in the portal.

Thursday, December 24, 2015

SP.Core.js file was not initialized during page post back in SharePoint 2013

Problem

Today we had an issue where the sp.core.js file was not initialized after the post back of a application page. So the other SharePoint JavaScript files like sp.js, sp.runtime.js threw errors (As in the screenshot below). So, the functionalities didn’t work as expected.

Capture

Environment

The sp.core.js file was referenced in the master page and our custom JavaScript file (the file where our functionalities are implemented. We were opening a modal pop up implementing some logics) was referenced in the aspx page. Our client wanted us to work only in the custom JavaScript file and not in the master page or in application page.

Solution 

We used registerSod function which is available in SharePoint Script On Demand (SP.SOD) framework in order to load build in SharePoint JavaScript libraries.
 
  1. /* SP.SOD.registerSod(key value (any unique string), path of the script file); --- */
  2. SP.SOD.registerSod('sp.core.js', '\\_layouts\\sp.core.js');
  3. /*  executeFunc is used to execute the file mentioned above. using dummy function --- */
  4. SP.SOD.executeFunc('sp.core.js', false, function () { });
  5. SP.SOD.registerSod('sp.js', '\\_layouts\\sp.js');
  6. SP.SOD.executeFunc('sp.js', false, function () { });
  7. SP.SOD.registerSod('sp.ui.dialog.js', '\\_layouts\\sp.ui.dialog.js');
  8. SP.SOD.executeFunc('sp.ui.dialog.js', false, function () { });

Reference

http://www.vlieshout.net/sharepoint-2013-lazy-loading-javascript/






Wednesday, December 23, 2015

Remote debug SharePoint Provider hosted add-in deployed in Azure

Steps

  1. Deploy your provider hosted add-in to azure website with the configuration setting as “Debug”. debug1
  2. On Visual Studio (My version is 2013) go to server explorer and sign into your azure subscription. imageimage
  3. Once you are success all your azure services will be listed. image
  4. Now right click on your azure website where the provider hosted app is deployed and click in the Attach debugger.  image 
  5. Now you can debug your provider hosted app
image

Wednesday, October 14, 2015

Microsoft SharePoint Server 2016 IT Preview is available in Azure Platform Gallery

SharePoint Server 2016 IT preview is available in Azure Platform which installs binaries in Windows Server 2012 R2 Datacenter. Here are the screenshots on creating virtual machine with SharePoint 2016 IT preview binaries. Once you create the VM you need to run the configuration wizard and follow the steps as here.

001

 

002

 

003

 

004