Error: Method not found: ‘System.Web.WebPages.IDisplayMode System.Web.Mvc.ControllerContext.get_DisplayMode()’.

I have received the following error message while using Sitecore MVC Development. Posted the resolution as it might help my fellow developers when facing the same issue.

Method not found: ‘System.Web.WebPages.IDisplayMode System.Web.Mvc.ControllerContext.get_DisplayMode()’.

Resolution: I have muted/deleted the following dll and everything started working normal ‘Microsoft.Web.Mvc.FixedDisplayModes.dll’


Building you first cloud hosted app on Office 365 – Using Napa

I was eavesdropping on one of the so called ‘Technical Elevator Conversations’

I heard “NAPA”.

Did some Googling, sorry some Binging as well and started to assimilate some of the information available on MSDN and other blogs. Fell in love instantly! What’s fascinating about this is, you could develop & deploy  from the scratch a complete ‘Cloud hosted App’ via browser and mere JavaScript. You would be surprised that it took less than ten minutes for the whole thing.

I thought to keep it simple and started of creating a simple temperature conversion tool, which run on simple JavaScript and some lines of  HTML. After all, the whole idea is to use NAPA and create an app. So I quickly borrowed few lines of code from W3C schools and used it in my app.

Note: There are so many blogs and MSDN articles out there explaining Napa in great detail. I just made an attempt to keep it as simple as possible, just to give you a glimpse of what Napa is all about and get some first introduction to it.

Following is what I did

  1. Create or use existing SharePoint 2013 site on Office 365 portal
    Note: If you do not have an Office 365 account you could easily activate one with you MSDN subscription. If you do not have an MSDN subscription, you may sign up for Office 365 for home to start and exploring some of the features.
  2. Once you have your SharePoint 2013 site up and running you would navigate to Site Contents and click ‘add an app’ as highlighted below
  3. Go to SharePoint Store by click the link as highlighted below.Snap2
  4. Search for ‘Napa’ and you should find an app ‘Napa Office 365 Development Tools’. Go ahead and install it.Snap3
  5. Once the install is finished you should find in your ‘Site Contents’. You may click on it to start using ‘Napa’ or by clicking ‘Build an app’ option available on the home screen. Please see below, for both of these options.
    Option 1:
    Snap4 Option 2:Snap5
  6. Kick off the app creating by clicking ‘Add New Project’
  7. You will be prompted with options to create a different kind of app, choose ‘App for SharePoint’ and give your app a name.Snap7
  8. Once you completed the above step, you are now officially on ‘Napa’ and can start coding. As I mentioned in the beginning, I borrowed the following code from W3C schools which helps with temperature conversions from Celsius to Fahrenheit and vice-versa.Snap8
  9. That is you are almost done, click Publish icon as highlighted in the screen capture. This should prepare the package, deploy and launch the app.
  10. This is how the ‘Temperature Converter’ app looks like. Nothing fancy two text boxes and few lines of JavaScript.Snap10
  11. This app should now show up in your Site Contents, please see highlighted.Snap11
  12. Congratulate your self for building the first cloud hosted app and get a brew.

Set up the development environment for SharePoint 2013 on Azure

Setting up development environment for SharePoint is easy, if you have right hardware and software and basic understanding of the configuration.

For SharePoint 2007, it was simple, the hardware requirements were basic and I managed to get it working with a laptop with simple configuration. SharePoint 2013 now supports ‘App’ development and other new features that require a lot of additional RAM and a lot more hardware. So I decided NOT TO upgrade my hardware, instead make use of Azure privileges that come with my MSDN subscription.

This blog post will guide you on how to set up your developer instance on Azure and unfortunately, does not cover configuring your developer VM step by step. If you are interested to build your VM from the scratch, please follow SharePoint 2013 Virtual Machine Set up Guide (Version 3.0) from Critical Path Training.

Note: This post assumes that you already have an active subscription with ‘Microsoft Azure’. If you don’t have one, you can sign up for a trial account or if you have an active ‘MSDN Subscription’ you can enjoy a recurring $150 credit per month that ships with your subscription. This is a great way to start and I am using my subscription for all my Azure development. You may visit  Microsoft Azure Free Trial: Try Azure | Azure Free Trial

Note: All the screen captures of Azure portal are valid only during the time of writing this blog post i.e. January 2015.  Microsoft is very aggressive not only adding new features to the portal but enhancing its user experience.

Step 1: Navigate to Windows Azure Management Portal

Step 2: Click the    Azure New Icon    icon at the bottom of the screen.

Step 3: You should see the following screen with an option to add a Virtual Machine from the Gallery

Select VM from Azure Gallery

Select VM from Azure Gallery

Step 4:  Choose the ‘Image’ of your choice, following is what I have chosen in the portal


Step 5: Perform the following actions.

  1. Appropriate Virtual Machine Name
  2. Select  ‘TIER’ as ‘Basic’
    1. The Basic tier provides an economical option for dev/test workloads, and other applications that don’t require load-balancing, auto-scaling, or memory-intensive virtual machines. The Standard tier is recommended option for all production workloads.
  3. Choose the ‘SIZE’ as A4
    1. Make sure you choose from Basic
    2. Below high-lighted is the VM configuration I have chosen.
      Azure Virtual Machine Pricing
  4. Provide new Username and Password.

Step 6: Choose appropriate ‘REGION/AFFINITY GROUP’ 


Step 7:  Finish the configuration


 Step 8: Make sure the VM is up and running

Azure VM is running

Step 9: Download RDP file and connect to the VM
Once the VM status is ‘Running’  you can ‘CONNECT’ using the following highlighted option. Clicking on ‘CONNECT’ will download the ‘RDP’ file, double click and following the screen and log on to the VM. You should be using the same ‘Username’ and ‘Password’ you have used while creating the VM on Azure Portal

Connect to Azure VM

Step 9: Run the PowerShell Scripts 

The VM will be shipped along with few PowerShell Scripts that you need to run, to install and configure SharePoint environment, SQL Server and all the other required software. Trust me! It can’t get simpler than this, running one script spun up the whole SharePoint environment! Neat!

You will find the below highlighted shortcut on the desktop,  where you will find the script ‘ConfigureSharePointFarm.psl’, Run it!

Snap25Once you ran the PowerShell script you will be asked for the ‘localSPFarmAccountName’
and ‘localSPFarmAccountPassword’, enter these and you are all set!


Step 10: Finally, you are ready. Remember to smile 🙂

Search for ‘Central’ in the installed apps on the server and you should see the gorgeous Central Admin icon, pin it to the desktop. You are all set, Happy Programming!


Note: Remember to turn the VM off, if you are not using it. Remember, you will be charged for every minute for you VM to be available  and running.