Thursday 24 January 2013

Setting up SharePoint 2013 Development Environment

Setting up SharePoint 2013 Development Environment is not the most straight-forward procedure for a complete Visual Studio novice like me.
In fact, I spent quite a few hours trying to figure out this fairly tedious procedure and as a result, I have outlined the steps below:

Pre-Requisites


  1. SharePoint (either Server or Foundation) must be installed on the Server (Win 2008 R2 SP1 or Win 2012)
  2. Visual Studio 2012 (Professional, Premium or Ultimate) must be installed on the server
  3. You, the developer, must be a Local Admin on that server
In order to develop SharePoint 2013 and Office 2013 Apps in Visual Studio, when you select 'New Project...' you should see a menu structure like the following:


And then...

In order to see all these SharePoint 2013 templates, you will need to install a couple of other programs:

  1. SharePointServer 2013 Client Components SDK
  2. Microsoft OfficeDeveloper Tools for Visual Studio 2012  (Note that this is a Web Installer, so your server will need access to the Internet in order to download the required files.  If it doesn't have access to the Web, see b) below)

  3. a) Server has internet access
    If you are lucky enough that your server has access to the web, then the Web Platform Installer 4.0 (Web PI) should work fine and allow you to download the required Office Developer Tools.

    b) Server doesn't have access to the web.

    Quite commonly servers do not have Web Access on the server, the Web PI will not be able to connect to the Internet to download the latest resources.


    I Googled this for a while and thought I found a solution by downloading and installing officetools_bundle.exe from Microsoft SharePoint Developer Tools for Visual Studio 2012 - Preview:
    This all looked OK. I could now see the coveted Office/SharePoint 2013 project templates, but a problem remained whereby when I tried to create a new project using one of these templates, I got the following error:
    "An error occurred while trying to load come required components. Please ensure that the following pre-requisite components are installed: Microsoft Web Developer Tools Microsoft Exchange Web Services"
    In this case, you will need to follow instructions similar to this blog post from Terri Donohue.

    There are a couple of unique considerations for SharePoint:
    • Once you have downloaded the WebPICMD.exe to your desktop, open the Command prompt with "Run as Administrator". Otherwise, the results of the commands will flash up on the screen too quickly to see
    • The command is case sensitive! Ensure you call the command as WebpiCmd.exe /List /ListOption:Alll or you will get: "'wpicmd.exe' is not recognized as an internal or external command, operable program or batch file."
    • Note that  I changed Terri's command from ListOption: Available to ListOption: All
    • If you want to see the /List output in Notepad, append > list.txt to the end of the command (eg. WebpiCmd.exe /List /ListOption:All > list.txt)  This helps with searching for the product you require
    • The one we are looking for is "OfficeToolsForVS2012GA Microsoft Office Developer Tools for Visual Studio 2012 - Preview 2" (Or similar, depending on when you read this)
    • C:\CAT\WebPICMD\WebpiCmd.exe /Offline /Products:OfficeToolsForVS2012GA /Path:C:\CAT\WebPICMD
    • Take note of the output at the end of output when the command is complete:
                         Offline main feed:
                           file:///C:/CAT/WebPICMD/feeds/shadow-webproductlist.xml
                             To use the new offline feed, please run the following from the command line:
                               WebPICmd.exe /Install /Products:<products you want> /XML:<Offline main feed>
                                 Done !
            • Copy the WebPICMD directory to the exact same location on your server (eg. C:/CAT)
            • On the server, the command then becomes (remember to run as Admin):
              • C:\CAT\WebPICMD\WebpiCmd.exe /Install /Products:OfficeToolsForVS2012GA /XML:C:/CAT/WebPICMD/feeds/shadow-webproductlist.xml


          • Reboot the server
          • When you open Visual Studio, right click and select "Run as Administrator" as elevated permissions may be required.

          Troubleshooting:

          If you get the following error:
          "An error occurred while trying to load some required components. Please ensure that the following pre-requisite components are installed: Microsoft Web Developer Tools Microsoft Exchange Web Services"

          This means that the Developer tools are only partially installed. You will need to uninstall Microsoft Office Developer Tools for Visual Studio 2012 by:
          • Go to Control Panel > Uninstall a program
          • Select Microsoft Office Developer Tools for Visual Studio 2012 - Preview 2 - ENU
          • Click on Change to uninstall it. The setup program should launch.
          • Click on Uninstall.
          • Also, in Add/Remove Programs, uninstall  Microsoft Web Developer Tools Microsoft and Exchange Web Services if you can see them there
          • Either Download the Office Developer Tools using this Web Platform Installer, or follow the off-line instructions above.
          • This should install the Office Developer Tools and all the prerequisites (Exchange Web Services, LightSwitch HTML Client, etc).
          • Try creating your SharePoint 2013 Empty Project again.

          Tuesday 22 January 2013


          Developing SharePoint 2013 Napa Apps in Office 365 to use on your local SharePoint environment

          Napa has only been around a few months and already there is some great stuff on the net to get you started developing apps for Office 365.
          As such, this post is not really adding a lot of new content, it is just conveniently bringing some existing web content together in a step-by-step format.


          1.       Overview is here: http://msdn.microsoft.com/en-us/library/fp161179.aspx  (How to: Set up an environment for developing apps for SharePoint on Office 365)

          2.       Follow the steps here: http://msdn.microsoft.com/en-us/library/fp179924.aspx (Sign up for an Office 365 Developer Site)

          3.       Start playing with Napa and learn how to use it!

          a.       Run the project to see if it is what you want

          b.      Publish the project

          c.       Then, deploy it

          4.       Create a basic app: http://msdn.microsoft.com/en-us/library/office/apps/jj220041(v=office.15)  (How to: Create a basic app for SharePoint by using Office 365 Development Tools Preview)

          5.       Try some more complex examples here:





          6.       Option A: You have Visual Studio installed on your desktop:

          a.       You can open the project in Visual Studio now. This will automatically prompt you to install the Visual Studio Development tools for Office and SharePoint 2013 (http://msdn.microsoft.com/en-us/office/apps/fp123627.aspx)

          b.      Then you can edit this. Load it up to your own on-premise environment. Icons are 96*96px. The blue colour is: RGB(0, 114,198).

          7.       Option B: You do not have VS installed

          a.       After publishing the App, go to the publish location (https://your365site.sharepoint.com/Lists/AppPackages/Forms/AllItems.aspx)

          b.      Download the file to your desk top

          8.       Ensure that there is an App Catalog created in CA. If not, create one: http://msdn.microsoft.com/en-us/library/fp123530.aspx

          9.       Enable the apps, otherwise you will get: “Sorry, apps are turned off. If you know who runs the server, tell them to enable apps.” http://sharepointchick.com/archive/2012/07/29/setting-up-your-app-domain-for-sharepoint-2013.aspx

          10.   Install the app in your previously created App Catalog site collection (/sites/app)

          a.       Manually (Central Admin): http://msdn.microsoft.com/en-us/library/fp123517.aspx


          11.   Now when users select “Add an App” from SharePoint, you will see a Your Apps > From your Organization


          Further Reading:

          HTH :)